From: Ingo Molnar <mingo@elte.hu>
To: Justin Madru <jdm64@gawab.com>,
Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Roland McGrath <roland@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Kernel Testers List <kernel-testers@vger.kernel.org>,
"Justin P. Mattock" <justinmattock@gmail.com>
Subject: Re: [Bug #12505] 2.6.29-rc1 Firefox crashing on page load
Date: Tue, 20 Jan 2009 09:37:00 +0100 [thread overview]
Message-ID: <20090120083700.GA5277@elte.hu> (raw)
In-Reply-To: <20090120081650.GA29725@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
>
> * Ingo Molnar <mingo@elte.hu> wrote:
>
> > (added Cc:s)
>
> > Justin, does it work if you apply the patch below instead of the revert?
>
> hm, that patch wont build because the protect_asmlinkage macro is rather
> limited - it cannot deal with structure parameters.
>
> We might be better off with a revert here, and a comment added that points
> out the problem.
Below is the revert+document commit that i have queued up.
Justin, could you try the tip/master tree (which has this fix included):
http://people.redhat.com/mingo/tip.git/README
does Firefox still work fine?
Ingo
------------->
>From 779c9b9f8cb87cdfbd299ee7beb62e50ce139a92 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Tue, 20 Jan 2009 09:31:49 +0100
Subject: [PATCH] Revert "x86: signal: change type of paramter for sys_rt_sigreturn()"
This reverts commit 4217458dafaa57d8e26a46f5d05ab8c53cf64191.
Justin Madru bisected this commit, it was causing weird Firefox
crashes.
The reason is that GCC mis-optimizes (re-uses) the on-stack parameters of
the calling frame, which corrupts the syscall return pt_regs state and
thus corrupts user-space register state.
So we go back to the slightly less clean but more optimization-safe
method of getting to pt_regs. Also add a comment to explain this.
Resolves: http://bugzilla.kernel.org/show_bug.cgi?id=12505
Reported-and-bisected-by: Justin Madru <jdm64@gawab.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/syscalls.h | 2 +-
arch/x86/kernel/signal.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 9c6797c..c0b0bda 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -40,7 +40,7 @@ asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
struct old_sigaction __user *);
asmlinkage int sys_sigaltstack(unsigned long);
asmlinkage unsigned long sys_sigreturn(unsigned long);
-asmlinkage int sys_rt_sigreturn(struct pt_regs);
+asmlinkage int sys_rt_sigreturn(unsigned long);
/* kernel/ioport.c */
asmlinkage long sys_iopl(unsigned long);
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 89bb766..df0587f 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -632,9 +632,16 @@ badframe:
}
#ifdef CONFIG_X86_32
-asmlinkage int sys_rt_sigreturn(struct pt_regs regs)
+/*
+ * Note: do not pass in pt_regs directly as with tail-call optimization
+ * GCC will incorrectly stomp on the caller's frame and corrupt user-space
+ * register state:
+ */
+asmlinkage int sys_rt_sigreturn(unsigned long __unused)
{
- return do_rt_sigreturn(®s);
+ struct pt_regs *regs = (struct pt_regs *)&__unused;
+
+ return do_rt_sigreturn(regs);
}
#else /* !CONFIG_X86_32 */
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
next prev parent reply other threads:[~2009-01-20 8:38 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 21:28 2.6.29-rc2-git1: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-01-19 21:28 ` [Bug #12399] USB wakeup problem on multiple machines Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12402] 2.6.29-rc: kernel BUG at fs/xfs/support/debug.c:108 Rafael J. Wysocki
2009-01-28 23:39 ` Alexander Beregalov
2009-02-03 22:56 ` Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12415] WARNING: at drivers/net/wireless/iwlwifi/iwl-sta.c:689 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12400] git-latest: kernel oops in IOMMU setup Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12416] Recent change to kernel spikes out ccache/distcc Rafael J. Wysocki
2009-01-20 10:31 ` [PATCH] " Jan Beulich
2009-01-19 21:32 ` [Bug #12414] iwl4965 cannot use "ap auto" on latest 2.6.28/29? Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12418] Repeated ioctl(4, 0x40046445, ..) loop in glxgears Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12422] 2.6.28-git can't resume from str Rafael J. Wysocki
2009-01-20 0:39 ` Harvey Harrison
2009-01-20 1:46 ` Jeff Chua
2009-01-19 21:32 ` [Bug #12419] possible circular locking dependency on i915 dma Rafael J. Wysocki
2009-01-20 0:29 ` Wang Chen
2009-01-19 21:32 ` [Bug #12417] glx performance drop with: "x86: PAT: implement track/untrack of pfnmap regions for x86 - v3" Rafael J. Wysocki
2009-01-20 7:47 ` Ingo Molnar
2009-01-20 9:09 ` Alexey Fisher
2009-01-20 13:45 ` Alexey Fisher
2009-01-19 21:32 ` [Bug #12444] X hangs following switch from radeonfb console - Bisected Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12441] Xorg can't use dri on radeon X1950 AGP Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12427] cpumask change causes sparc build bustage Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12468] Crash in acpi_cpufreq_init Rafael J. Wysocki
2009-01-20 0:33 ` Alex Riesen
2009-01-20 14:23 ` Ingo Molnar
2009-01-20 22:35 ` Alex Riesen
2009-01-21 11:59 ` Ingo Molnar
2009-01-19 21:32 ` [Bug #12491] i915 lockdep warning Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12490] ath5k related kernel panic in 2.6.29-rc1 Rafael J. Wysocki
2009-01-20 22:44 ` Bob Copeland
2009-01-19 21:32 ` [Bug #12469] XFS : Corruption of in-memory data Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12495] thinkpad problems during resume Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12493] ACPI related kernel panic when booting 2.6.29-rc2 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12496] swsusp cannot find resume device (sometimes) Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12494] Sony backlight regression from 2.6.28 to 29-rc Rafael J. Wysocki
2009-01-20 16:46 ` Norbert Preining
2009-01-19 21:32 ` [Bug #12497] new barrier warnings in 2.6.29-rc1 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12498] OOPS and panic on 2.6.29-rc1 on xen-x86 Rafael J. Wysocki
2009-01-20 0:35 ` Nick Piggin
2009-01-19 21:32 ` [Bug #12499] Problem with using bluetooth adaper connected to usb port Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12501] build bug in eeepc-laptop.c Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12502] pipe_read oops on sh Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12503] [slab corruption] BUG key_jar: Poison overwritten Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12507] e100: netconsole not functional because of missing firmware Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12506] Undefined symbols when CONFIG_MFD_PCF50633 is enabled Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12505] 2.6.29-rc1 Firefox crashing on page load Rafael J. Wysocki
2009-01-20 6:29 ` Justin Madru
2009-01-20 7:43 ` Ingo Molnar
2009-01-20 8:16 ` Ingo Molnar
2009-01-20 8:37 ` Ingo Molnar [this message]
2009-01-21 9:31 ` Justin Madru
2009-01-21 9:40 ` Justin P. Mattock
2009-01-19 21:32 ` [Bug #12504] 2.6.29-rc1 vs selinux Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12511] WARNING: at drivers/dma/dmaengine.c:352 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12509] lockdep report. fb_mmap vs sys_mmap2 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12508] "powerpc/pci: Reserve legacy regions on PCI" broke my G3 Rafael J. Wysocki
2009-01-19 21:32 ` [Bug #12510] 2.6.29-rc2 dies on startup Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2009-02-04 10:21 2.6.29-rc3-git6: Reported regressions from 2.6.28 Rafael J. Wysocki
2009-02-04 10:24 ` [Bug #12505] 2.6.29-rc1 Firefox crashing on page load Rafael J. Wysocki
2009-02-04 15:23 ` Justin Mattock
2009-02-04 16:46 ` Ingo Molnar
2009-02-04 18:15 ` Justin Mattock
2009-02-05 1:08 ` Rafael J. Wysocki
2009-02-05 1:37 ` Justin Mattock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090120083700.GA5277@elte.hu \
--to=mingo@elte.hu \
--cc=h-shimamoto@ct.jp.nec.com \
--cc=hpa@zytor.com \
--cc=jdm64@gawab.com \
--cc=justinmattock@gmail.com \
--cc=kernel-testers@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=roland@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).