Skip to contentSkip to conversation

Fix request_module from ia32 process

Linux-ia64 Applied Andreas Schwab 3 participants 3 messages Mar 27, 2003 – Apr 16, 2003

lore
Share & tools
lore
#0 lore raw

When an ia32 process triggers request_module the kernel cannot execute modprobe because the kernel thread still has the ia32 address limits in force. I think a kernel thread should always have the ia64 address limits, similar to what sys32_execve is doing.

Andreas.

arch/ia64/kernel/process.c renamed from arch/ia64/kernel/process.c.~1~ +9 -0
@@ -476,6 +476,15 @@ kernel_thread (int (*fn)(void *), void *
 
 	tid = clone(flags | CLONE_VM, 0);
 	if (parent != current) {
+#ifdef CONFIG_IA32_SUPPORT
+		if (IS_IA32_PROCESS(ia64_task_regs(current))) {
+			/* A kernel thread is always a 64-bit process. */
+			current->thread.map_base  = DEFAULT_MAP_BASE;
+			current->thread.task_size = DEFAULT_TASK_SIZE;
+			ia64_set_kr(IA64_KR_IO_BASE, current->thread.old_iob);
+			ia64_set_kr(IA64_KR_TSSD, current->thread.old_k1);
+		}
+#endif
 		result = (*fn)(arg);
 		_exit(result);
 	}
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab

Andreas> When an ia32 process triggers request_module the kernel Andreas> cannot execute modprobe because the kernel thread still has Andreas> the ia32 address limits in force. I think a kernel thread Andreas> should always have the ia64 address limits, similar to what Andreas> sys32_execve is doing.

Applied in 2.5, thanks.

	--david
#2 lore raw
In reply to Andreas Schwab
Quoted 4 lines · Andreas Schwab

When an ia32 process triggers request_module the kernel cannot execute modprobe because the kernel thread still has the ia32 address limits in force. I think a kernel thread should always have the ia64 address limits, similar to what sys32_execve is doing.

I applied this in 2.4.