[PATCH 74/74] lto, workaround: Mark do_futex noinline to prevent clobbering ebp
[Posted August 21, 2012 by corbet]
| From: |
| Andi Kleen <andi-AT-firstfloor.org> |
| To: |
| linux-kernel-AT-vger.kernel.org |
| Subject: |
| [PATCH 74/74] lto, workaround: Mark do_futex noinline to prevent clobbering ebp |
| Date: |
| Sat, 18 Aug 2012 19:57:10 -0700 |
| Message-ID: |
| <1345345030-22211-75-git-send-email-andi@firstfloor.org> |
| Cc: |
| x86-AT-kernel.org, mmarek-AT-suse.cz, linux-kbuild-AT-vger.kernel.org,
JBeulich-AT-suse.com, akpm-AT-linux-foundation.org,
Andi Kleen <ak-AT-linux.intel.com> |
| Archive‑link: | |
Article |
From: Andi Kleen <ak@linux.intel.com>
On a 32bit build gcc 4.7 with LTO decides to clobber the 6th argument on the
stack. Unfortunately this corrupts the user EBP and leads to later crashes.
For now mark do_futex noinline to prevent this.
I wish there was a generic way to handle this. Seems like a ticking time
bomb problem.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
kernel/futex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index 3717e7b..48b5a07 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2620,7 +2620,7 @@ void exit_robust_list(struct task_struct *curr)
curr, pip);
}
-long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
+noinline long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
u32 __user *uaddr2, u32 val2, u32 val3)
{
int cmd = op & FUTEX_CMD_MASK;
--
1.7.7.6