From patchwork Mon Nov 12 03:06:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 150776 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2663794ljp; Sun, 11 Nov 2018 19:09:07 -0800 (PST) X-Google-Smtp-Source: AJdET5cS/x8YfRyJa63vv6J3auFOk+ZAw7PZaouHfCadxh7Sdbef9IcSLnNZrac2Pb20RyNx0A/J X-Received: by 2002:a63:7418:: with SMTP id p24mr16144248pgc.196.1541992147647; Sun, 11 Nov 2018 19:09:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541992147; cv=none; d=google.com; s=arc-20160816; b=tTFDp+u1JVqBSiDIuyYTqiJxKMleT9tpQ+cD7r/5aAWZOAxar/Wd57xG8fF0O3KxoY BTBVrr8WFGCm8SEE3aMtaHGsqZPRDDknuK3SygJE8xK9MPwVjJ6PODweFO8MLBItDzDw rUD4/2K1+uvfx/0qhelBXIcnUjkd5TOm6s6WN5C0DxU8vqh0bC9uf5rHxFcQSTxIIcnp 6SIoqeYYpCciLdytY+xwpN767mj/kKMmykOnudW/94StKlZq5BO0PWuw7Hr7o7HPD7oL B4qqriL9GxfCfCrD9zS6ChtPboIeDvKoVnLRv9NyAUL4g3o9tCESk4bx+LX5G2N1uzf3 mawA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=EQtZeS28ax5HpUb/J23GhibEmAIqFru8uBOxwQqeoXU=; b=Iq7pJhqQJT1tc9kCh7kc/c/2yLZOddvOic9XsVjlk0g434xYRwayzQUtVd8zh3OpwS mpI1goDgqUZYwWco50pF4k2QOhUxtfBOUkJhrGqieCgtyeF6Ev5WBgzFMVo4XsS35jb6 Ab1twvlbfv4zZ2V/WI82wBh1HyuuUf650GR+Mp/no66ds9f9N9LWkE2W7EJCIhjFgpQp Y0maYnJU4umU1lXeoMEMxEwMp1cnZmTh6VOePdxvx8+D/6t1I8sox3BP4J7MEV4l4aj5 OZK6Rfl95RHAB5eA9qe2KvcYHnLhbVh865fnMi3SVw0thho6UvD5PHnLJywbOgo70bSt whMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SteWWvxL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si15493591pgb.66.2018.11.11.19.09.07; Sun, 11 Nov 2018 19:09:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SteWWvxL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730385AbeKLNAL (ORCPT + 32 others); Mon, 12 Nov 2018 08:00:11 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:35038 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbeKLNAL (ORCPT ); Mon, 12 Nov 2018 08:00:11 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wAC37UKv026216; Mon, 12 Nov 2018 12:07:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wAC37UKv026216 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1541992051; bh=EQtZeS28ax5HpUb/J23GhibEmAIqFru8uBOxwQqeoXU=; h=From:To:Cc:Subject:Date:From; b=SteWWvxL+jWzGlye+zn54QpGvmG0absy/rqlZMLtv4cFJWzB5Ezy19/I9FA/Ra2+s 6psxkj3Ko8kKmN6snWYZRfvgf1L0+I8I/hpbPVuVScPL8Lohh8x3BSJgGltYoQDOkM BQd+l+lFp58DeuCCwKmhe1Da/bRU0UXqnYkuYgex+TIKVhA4Y6o261+CCBZ8UuOy/T yfvtaps+rQw/i4Qz8z2j4wHgFsxfeZ6z66RFBen71JbZBQ8VYBMOsKEQthBPx+DdQI Yxm/Mclm85tRxQ0Y70ees455xo2hAOEZM3XVExKqQugtl+TC3p2tt0d/ny3aSeWHUN fjJzI5HPFlGLQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , x86@kernel.org Cc: Linus Torvalds , Kees Cook , Masahiro Yamada , "H. Peter Anvin" , Borislav Petkov , linux-kernel@vger.kernel.org, Sven Joachim Subject: [PATCH] x86: remove gcc-x86_*-has-stack-protector.sh checks Date: Mon, 12 Nov 2018 12:06:53 +0900 Message-Id: <1541992013-18657-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-x86_64-has-stack-protector.sh was introduced by commit 4f7fd4d7a791 ("[PATCH] Add the -fstack-protector option to the CFLAGS") in 2006 to work around buggy compilers. gcc-x86_32-has-stack-protector.sh was introduced by commit 60a5317ff0f4 ("x86: implement x86_32 stack protector"), which did not clearly state whether compilers were still producing broken code at that time. Now, the minimum reuquired GCC version is 4.6, which was released in 2011. Probably, we can dump these old compiler checks. Signed-off-by: Masahiro Yamada --- arch/x86/Kconfig | 10 +--------- scripts/gcc-x86_32-has-stack-protector.sh | 4 ---- scripts/gcc-x86_64-has-stack-protector.sh | 4 ---- 3 files changed, 1 insertion(+), 17 deletions(-) delete mode 100755 scripts/gcc-x86_32-has-stack-protector.sh delete mode 100755 scripts/gcc-x86_64-has-stack-protector.sh -- 2.7.4 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 9d734f3..7240d50 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -187,7 +187,7 @@ config X86 select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION select HAVE_FUNCTION_ARG_ACCESS_API - select HAVE_STACKPROTECTOR if CC_HAS_SANE_STACKPROTECTOR + select HAVE_STACKPROTECTOR select HAVE_STACK_VALIDATION if X86_64 select HAVE_RSEQ select HAVE_SYSCALL_TRACEPOINTS @@ -352,14 +352,6 @@ config PGTABLE_LEVELS default 3 if X86_PAE default 2 -config CC_HAS_SANE_STACKPROTECTOR - bool - default $(success,$(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC)) if 64BIT - default $(success,$(srctree)/scripts/gcc-x86_32-has-stack-protector.sh $(CC)) - help - We have to make sure stack protector is unconditionally disabled if - the compiler produces broken code. - menu "Processor type and features" config ZONE_DMA diff --git a/scripts/gcc-x86_32-has-stack-protector.sh b/scripts/gcc-x86_32-has-stack-protector.sh deleted file mode 100755 index f5c1194..0000000 --- a/scripts/gcc-x86_32-has-stack-protector.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m32 -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs" diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh deleted file mode 100755 index 75e4e22..0000000 --- a/scripts/gcc-x86_64-has-stack-protector.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"