From patchwork Sun Aug 19 02:57:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1343341 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 175073FC33 for ; Sun, 19 Aug 2012 03:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753437Ab2HSC7o (ORCPT ); Sat, 18 Aug 2012 22:59:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:44069 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983Ab2HSC5p (ORCPT ); Sat, 18 Aug 2012 22:57:45 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Aug 2012 19:57:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,792,1336374000"; d="scan'208";a="204911370" Received: from tassilo.jf.intel.com ([10.7.201.151]) by fmsmga001.fm.intel.com with ESMTP; 18 Aug 2012 19:57:26 -0700 Received: by tassilo.jf.intel.com (Postfix, from userid 501) id 5F171241947; Sat, 18 Aug 2012 19:57:26 -0700 (PDT) From: Andi Kleen To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, mmarek@suse.cz, linux-kbuild@vger.kernel.org, JBeulich@suse.com, akpm@linux-foundation.org, Andi Kleen 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> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1345345030-22211-1-git-send-email-andi@firstfloor.org> References: <1345345030-22211-1-git-send-email-andi@firstfloor.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Andi Kleen 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 --- 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;