From patchwork Thu Oct 26 16:00:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Gerst X-Patchwork-Id: 158604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp781793vqb; Thu, 26 Oct 2023 09:02:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEL5zS/N/0Xn7DPBUa2YJ7Xn1Q9PNCzFnBvsLoQeizObT5RVZkadMSKqmP8bPu+1xhdFUaA X-Received: by 2002:a05:6830:618:b0:6bd:9e1c:93a6 with SMTP id w24-20020a056830061800b006bd9e1c93a6mr2078707oti.0.1698336134389; Thu, 26 Oct 2023 09:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698336134; cv=none; d=google.com; s=arc-20160816; b=02rirWEFPahZijntupdRvGfbdPdM00cOK0T7wYlwZ2v1crmzGBamVFXWIF7qLtQqhF M/bjgILuxFMycNjHtDim7f4jQ68w9GRZKJHYMgRIFDYCzbpC4lknSAzgTPAgITo9JckX KORrwnCXis43KaCfWn0Ij/vrqmpJoEQY3aBcbyWqEuB4OdrYz2lP1dUONn2a4FTHB1ju 7+Jp6xJgWrZZHsv9C08U2dftOtCjfZPMfTYe+hoAHI4t1JHSV6ePl8oE2wDOctLc1I94 IUcBkT5Y//YAkqWxf2nVNLw7ltaZ+eAsAbLNb9ZgfGozQcZwp1GhT1e7e5lcBj3Nv9Cu NYOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6Eshj9ssogtik9Akv+/0p6H72PveiCEWZM0GK4P1lOg=; fh=kGpLZLNLRje3BV+NP+TIHFvhQuUJy2o1P7WKpXu8DOs=; b=UbQlMBwvHsIoSYCgWWz9QOxHQKBv01NxNX4uiR1XmTttkLDZq69q/OCoRhuOKKDckw dR3EEaXtn+Yyw38H1QE1WstGZewmPhdNIHyBBijrCkVi8YcvVlzcnWfVB7C9MJuYJ1SY ZPa+PfRGymvOf6ywZ97N3e6+Zz9H07UMSSCzZAje+aiEHg+Qz9YEym+gCLYNMlueJSfw A5qvx07y3gyXP3Nd8eyxSH9ztsidCifT9k0JnFteGplNjYACl69TxWqYmGhhdANLwpgS yPkz0OUUDOJB43STkYKV7rUJLznF1YbSgkahIfP/s+wuWxDTL+Sfo1/jB4lENgxITfWE Mtcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OkoLIX6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id g20-20020a9d6a14000000b006d1ac4b440dsi957515otn.309.2023.10.26.09.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 09:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OkoLIX6X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 751FE80D6AD7; Thu, 26 Oct 2023 09:01:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235087AbjJZQBh (ORCPT + 26 others); Thu, 26 Oct 2023 12:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235072AbjJZQBa (ORCPT ); Thu, 26 Oct 2023 12:01:30 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D5671BC for ; Thu, 26 Oct 2023 09:01:27 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5a7a80a96dbso19652607b3.0 for ; Thu, 26 Oct 2023 09:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698336087; x=1698940887; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Eshj9ssogtik9Akv+/0p6H72PveiCEWZM0GK4P1lOg=; b=OkoLIX6XzzwhgdyCMTG8iAGU4SqCs2PwRyw1wQB8sCZy4e95zRwjuUQNSi54YnyWuD Y3IolT3RkKI+O91OQigu44miZGubYjv+lmuyJb9sVhvDXTptjNNJKz/JMY6FhTD6RWAh 04lzE9ubTByYfpDgbWzSBIVLzgsXYKna/llX5aK5VizkyE7jq5yZ+9i42k7wDAqX50wl vm3tjOnOwsQA3z9wdYXQUemp3WFo2yHCizfUTbdflsGWhsX5+VyuPY9CurXFPLaAZMVq xKlHKgewqhj3Mu5vz8gYZv2GFC38Bssv0BNTx1pxupw6iFwwCCRBVPtle86jmJb+OW20 7CGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698336087; x=1698940887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Eshj9ssogtik9Akv+/0p6H72PveiCEWZM0GK4P1lOg=; b=b6HLkGFeV9ij+DXxydy/R3nVbHSXqgCGgPh4/4Cmk/fJdf9i0KmpbOAwcnkG3yg8Ha VC/InkBXQWMdwgM7+L5NGW2sl0IaH0RT/3pMBNd51rK8LSTK5qmp/kJKGp9xBWZkznmt frLYymDAVEyXEtr+OWLtVa3slQ/vlSvaWcK5Or8QbFHSWBF9HG8SyKtd6e+a4BvVE960 umdylS8UKYBuo7DV9kyVXpUZ3njU7t2YYkYQsECfsh9rrloJJplyn8QCeXSXbrrN4Xdr Ing2IZEmQu3X0WTgpbLMXUZUQVE6kpju0g5yJWn7dAyHeUafs/HFRUivfhyBkVJRktkH dSxA== X-Gm-Message-State: AOJu0YxtuTkRupIINveIY0JjxKGSun2J6RocivbsXVE+BoVqVeQI2Q0f AMCFLp4cOHdF+Ti5njOY0Q4bYZHBbg== X-Received: by 2002:a05:690c:708:b0:5a7:b53a:3223 with SMTP id bs8-20020a05690c070800b005a7b53a3223mr5207193ywb.21.1698336086730; Thu, 26 Oct 2023 09:01:26 -0700 (PDT) Received: from citadel.lan ([2600:6c4a:4d3f:6d5c::1019]) by smtp.gmail.com with ESMTPSA id a71-20020a0dd84a000000b005a20ab8a184sm6130129ywe.31.2023.10.26.09.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 09:01:26 -0700 (PDT) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , Peter Zijlstra , Uros Bizjak , Brian Gerst Subject: [PATCH v2 02/11] x86/stackprotector/64: Remove stack protector test script Date: Thu, 26 Oct 2023 12:00:51 -0400 Message-ID: <20231026160100.195099-3-brgerst@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231026160100.195099-1-brgerst@gmail.com> References: <20231026160100.195099-1-brgerst@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 09:01:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780834510238803146 X-GMAIL-MSGID: 1780834510238803146 This test for the stack protector was added in 2006 to make sure the compiler had the PR28281 patch applied. With GCC 5.1 being the minimum supported compiler now, it is no longer necessary. Signed-off-by: Brian Gerst Reviewed-by: Uros Bizjak --- arch/x86/Kconfig | 2 +- scripts/gcc-x86_64-has-stack-protector.sh | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100755 scripts/gcc-x86_64-has-stack-protector.sh diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 039872be1630..92144c6f26d2 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -410,7 +410,7 @@ config PGTABLE_LEVELS config CC_HAS_SANE_STACKPROTECTOR bool - default $(success,$(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC) $(CLANG_FLAGS)) if 64BIT + default y if 64BIT default $(cc-option,-mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard) help We have to make sure stack protector is unconditionally disabled if 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 75e4e22b986a..000000000000 --- 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"