Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp540641pxb; Tue, 14 Sep 2021 03:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB41Nc/NutrY6Vg5WK3JfsAUWhL9NyhNTglid/1y/BUl4gvl1aiEfDtg8EV61rnOBVMYFk X-Received: by 2002:a05:6602:1543:: with SMTP id h3mr12833899iow.123.1631615392259; Tue, 14 Sep 2021 03:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631615392; cv=none; d=google.com; s=arc-20160816; b=g2btwl9hWoQGPY+kTlVi5jRZhRgVk2U3vfXPlyLWNLuWQPhxH+Mf/F+tLYEVwBr6CV rV8C2dWUGqcJcthUsfOvmaHjPjsEx4HcWY1Yl/cK8oABGMHr9ZJeTW4BHzOB1RoowQR6 ctBwMwel0PKlwX3DzmKxuR17yREUp9LzoKGTp+RU2JF/4vFkXyb4To/6hWV7CBQ8iMYF 2yw6ichrhyQSgI/uYSOHz9/Dxizqhbue3lKd/NH/h9JZGybUCy9IaQR7lPDYQy+D1/KG Zck/zwaqyzo2+fPGeV1WR4VlPlPZvL0NPFy6qluDJUQPYDKUUyaaaoHfRe3wxnnu8nrb MVfA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=qWkSX0ycKSQQi9Sz+7y7+yLS8AbnonFzScu5Qobgi+s=; b=XU3H8Ozkgg7E8e3W9w9k6C80kza/DShCMpADJYnsXKRFnb5U6KAh08TU2+5FsYoUMA wyPA9iCsMWKPd1sfmJKI039fNPnJujnXsIgznFtOegDTqxPdK2fCdHAS39vGDZeilw/p P2b+NXCheZIoBvUdi/pZRlnBOudqH+PbV39fxOctD5lKH54PJaAD7vahkhZoa/2ejhXT lFMIWUrnD7P8Gx5u5dK17y8CQ8Y+0F2VsV84GU2bpMeaCeOVhBtNaK45JQJWXwJXyWYz OYBHNmX1RN8Y5vCZefFUq31izsrG/2I1XiY1jM2DlAIQYAXCEpIaC2+/fsjUlzHBPKsH VKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TI7IjmyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si9506313ilc.24.2021.09.14.03.29.38; Tue, 14 Sep 2021 03:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TI7IjmyK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbhINKaH (ORCPT + 99 others); Tue, 14 Sep 2021 06:30:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:34604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbhINKaG (ORCPT ); Tue, 14 Sep 2021 06:30:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8FCD660F21; Tue, 14 Sep 2021 10:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631615329; bh=IothWu7mCcEpfkccHVCp122mEcJcmkyW3Tzq9Brg0d4=; h=From:To:Cc:Subject:Date:From; b=TI7IjmyK6rB156grO+FnLIpz+kC8luvhmMaVvZCScsz/BZ21THgUKHYZtg7IJothM ubTq3/jqoIzMWOXx0k9tZWs74+4pqqtCvR8cw22fgL+8g6DiXBLeBBCWYHWyIcYASf Nx85o8CSRuu/hpoyhl98dppRgyOmmZ4NrWdKDlQepBkPkjZ+6LTrJTv7pKuY9cQ3ck SLaaLdsOUxrd+KO4JZRIqqe+y6g2d6cZlqpYtaAVIBEGNXa4mMSTXwpDBe7xgwED+Q XuyM6DXhtB7huGV1Kstqv0ft6ZT9CaK560MI9gTuyYN2vDhoJ51KM1AknRs/RWiRJh +KSQIePrkRZrA== From: Will Deacon To: linux-kernel@vger.kernel.org Cc: linux-security-module@vger.kernel.org, Will Deacon , Kees Cook , Nathan Chancellor , Nick Desaulniers , "Gustavo A . R . Silva" , Greg Kroah-Hartman Subject: [PATCH] hardening: Default to INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO Date: Tue, 14 Sep 2021 11:28:37 +0100 Message-Id: <20210914102837.6172-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CC_HAS_AUTO_VAR_INIT_ZERO requires a supported set of compiler options distinct from those needed by CC_HAS_AUTO_VAR_INIT_PATTERN, Fix up the Kconfig dependency for INIT_STACK_ALL_ZERO to test for the former instead of the latter, as these are the options passed by the top-level Makefile. Cc: Kees Cook Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Gustavo A. R. Silva Cc: Greg Kroah-Hartman Fixes: dcb7c0b9461c ("hardening: Clarify Kconfig text for auto-var-init") Signed-off-by: Will Deacon --- I just noticed this while reading the code and I suspect it doesn't really matter in practice. security/Kconfig.hardening | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index 90cbaff86e13..341e2fdcba94 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -29,7 +29,7 @@ choice prompt "Initialize kernel stack variables at function entry" default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL if COMPILE_TEST && GCC_PLUGINS default INIT_STACK_ALL_PATTERN if COMPILE_TEST && CC_HAS_AUTO_VAR_INIT_PATTERN - default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_PATTERN + default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO default INIT_STACK_NONE help This option enables initialization of stack variables at -- 2.33.0.309.g3052b89438-goog