Commit 9a357b21 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Richard Henderson

[PATCH] alpha: execve() fix

The 2.5 kernels may hang on execve(). Most easily this can be reproduced
by submitting forms in mozilla, apparently because it does execve with
very long argument strings.
That's what happens in do_execve, I suppose:
	bprm.mm = mm_alloc();
	...
	init_new_context(current, bprm.mm); here we update current ptbr
					    with new mm->pgd
	...
	copy_strings;
			interrupt -> do_softirq -> switch to ksoftirqd
			...
			switch back to do_execve;
	copy_strings -  immediate page fault in copy_user that we can't
			handle because the new ptbr has been activated
			after context switch and current->mm is not
			valid anymore.

The fix is to not update ptbr for current task in init_new_context(),
as we do it later in activate_mm() anyway.

With it my (UP) boxes look quite stable so far.

Ivan.
parent cacc230d
...@@ -232,8 +232,9 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) ...@@ -232,8 +232,9 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
for (i = 0; i < NR_CPUS; i++) for (i = 0; i < NR_CPUS; i++)
if (cpu_online(i)) if (cpu_online(i))
mm->context[i] = 0; mm->context[i] = 0;
tsk->thread_info->pcb.ptbr if (tsk != current)
= ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT; tsk->thread_info->pcb.ptbr
= ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment