Re: 2.6.29-rc3-git6: Reported regressions from 2.6.28

From: Ingo Molnar
Date: Wed Feb 04 2009 - 11:33:08 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=12505
> > Subject : 2.6.29-rc1 Firefox crashing on page load
> > Submitter : Justin Madru <jdm64@xxxxxxxxx>
> > Date : 2009-01-16 20:56 (20 days old)
> > First-Bad-Commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4217458dafaa57d8e26a46f5d05ab8c53cf64191
> > References : http://marc.info/?l=linux-kernel&m=123213941914274&w=4
> > Handled-By : Justin P. Mattock <justinmattock@xxxxxxxxx>
>
> Heh. That commit you point to is very innocuous.
>
> Commit 4217458dafaa57d8e26a46f5d05ab8c53cf64191 is a pure cleanup, and it
> _does_ make the code look nicer, but while it looks lik a total no-op, it
> actually has a very subtle behavioural change: it makes gcc think that it
> owns the whole argument stack. Which is _not_ true of 'asmlinkage'
> functions, but we've never been able to tell gcc to keep its grubby hands
> off our stack.
>
> So I suspect that gcc inlines the function and then creates a function
> call that re-uses the "struct pt_regs" on the stack as the argument area
> too. Which corrupts the "pt_regs", and then we return to user space with
> some random register contents.

yes - i tracked it down back then, just the regression entry didnt get
updated.

> So I think we need to just revert it. Ingo, Hiroshi?

should be fixed upstream by:

552b8aa: Revert "x86: signal: change type of paramter for sys_rt_sigreturn()"

the revert commit is below with explaination - also with a Tested-by tag.
The revert is not a pure revert - it also adds a comment to preserve this
circumstance cleanly.

We first had a few fruitless attempts to annotate it in some clear fashion
(the existing tailcall-avoidance macros we have didnt suit this case) - then
went for the revert because none of the variants that told gcc not to screw
up actually made the code better than it was originally.

Ingo

-------------->