Message ID | 20230203194201.92015-1-ebiggers@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1027086wrn; Fri, 3 Feb 2023 11:46:42 -0800 (PST) X-Google-Smtp-Source: AK7set/qcLtRVbXTX9Xg0cSs7LVOlN8HOhYH2RA3QMenwpQgvx1dZe8NaX5TcNSLSF9S9JC25W5h X-Received: by 2002:a05:6a00:4ac3:b0:593:f638:5bba with SMTP id ds3-20020a056a004ac300b00593f6385bbamr9459353pfb.7.1675453602448; Fri, 03 Feb 2023 11:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675453602; cv=none; d=google.com; s=arc-20160816; b=tlWBAn/8ENwN4CGu2aKSwrYUsNpIaWRH8VkTvIXGh/bBVcFblp1XG4Z/2eC59/Rmuw Zw7t6r5/Rsx8OjNryeU+yQ1m3+DlKNq8XzhDRvOtLy93KixrGT1zHQ1KBGENxlllgLaI w8G9pG6nCP6jeD1o7UTdZxpiNPygyCOepO4gK0Sc1esz5L2kgeDLAck+rb6NY3zFOKfn mSIl8gkw7MTDIJIkbrvH9myEwlUjAxefjfvA4rhL7vosykxKb4dNO5VZyDP5KzATRUq5 M8Mm656M0jJok2Su4FNHd228zMqWlZe+bS0s9zS8LnFbzk/euWiC9wn2sddsaqjYUmuI RyFQ== 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=M9E54IKlvpt9CarA0SaBuAYXCtQmcesDQJ+xhU7Sq2w=; b=JU0Al0BkjU+EAmqx3L17Vl6T9OtttX/k2fim66wNcwtiWhhgoGaJVpCrx2DRHPv+3z QKFMGGBr3Mxz64ExGYiYK4w/X5X65jkHQSvkuU4VIygb2Azz5cEIYSxaB5zdfNQ5W9xb 83OtQaZHowcvR+a06QEA7KqPue7ugbD+2XGwzcckVV80T4czVXzUkLS3xjGsALiKIENt eWWhV1OV3CLsy81I00fcBexXBrZKfAru1trSuTg+3HfoTFTSXDWcIjcqXlhP7iA95UBj aoyfXj/r+LG0mpGBEAnAqSoRRzVQW7Cnw2iomy50X/AZaY3KVjrxM3kG7D7bfT7dXv5j vDyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JHGDBupa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a62b60c000000b0058bc2deac15si3039011pff.134.2023.02.03.11.46.25; Fri, 03 Feb 2023 11:46:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JHGDBupa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233142AbjBCTmX (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Fri, 3 Feb 2023 14:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231302AbjBCTmV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Feb 2023 14:42:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35AF78690; Fri, 3 Feb 2023 11:42:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CFCA7B82B96; Fri, 3 Feb 2023 19:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C22AC433D2; Fri, 3 Feb 2023 19:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675453337; bh=IYzoVTIy3jIOIBOxqEJpVTIpJjJqrpgiE5pvZS0VH/s=; h=From:To:Cc:Subject:Date:From; b=JHGDBupaxkFj6TtnW5AILupv53mu/iLhuc83Mpx09BuiNansznU1Msi/43oXapNzZ lBVUv3c7cs0uVN8ZqG/2x1ryXeTbRGfG5ds+doV956A2ZN2ynlleYi/ADneOHhjnsn OSiuDpAi7ULiBfwlugRhuD4npPePuICKj+8XC7qXhH9nRlgnisR2vq0QIY5ZlKtRPu CbUUs8XPanZZhgxD6hB7a8lrIcjTTzcI52rFuBQCopOh46L1tSoHtuWVkjE6Eutc+2 nRznQMRP/WdDEXAHVm0VXX9QG1cDTBRI3UmK9qnNjKEh8JTrishReM5gqkymPIt+1H 8CMZ6dnSyUnnQ== From: Eric Biggers <ebiggers@kernel.org> To: linux-hardening@vger.kernel.org, Kees Cook <keescook@chromium.org> Cc: llvm@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] randstruct: temporarily disable clang support Date: Fri, 3 Feb 2023 11:42:01 -0800 Message-Id: <20230203194201.92015-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756840436587309750?= X-GMAIL-MSGID: =?utf-8?q?1756840436587309750?= |
Series |
randstruct: temporarily disable clang support
|
|
Commit Message
Eric Biggers
Feb. 3, 2023, 7:42 p.m. UTC
From: Eric Biggers <ebiggers@google.com> Randstruct with clang is currently unsafe to use in any clang release that supports it, due to a clang bug that is causing miscompilations: "-frandomize-layout-seed inconsistently randomizes all-function-pointers structs" (https://github.com/llvm/llvm-project/issues/60349). Disable it temporarily until the bug is fixed and the fix is released in a clang version that can be checked for. Fixes: 035f7f87b729 ("randstruct: Enable Clang support") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> --- security/Kconfig.hardening | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: 7b753a909f426f2789d9db6f357c3d59180a9354
Comments
On Fri, Feb 03, 2023 at 11:42:01AM -0800, Eric Biggers wrote: > From: Eric Biggers <ebiggers@google.com> > > Randstruct with clang is currently unsafe to use in any clang release > that supports it, due to a clang bug that is causing miscompilations: > "-frandomize-layout-seed inconsistently randomizes all-function-pointers > structs" (https://github.com/llvm/llvm-project/issues/60349). Disable > it temporarily until the bug is fixed and the fix is released in a clang > version that can be checked for. > > Fixes: 035f7f87b729 ("randstruct: Enable Clang support") > Cc: stable@vger.kernel.org > Signed-off-by: Eric Biggers <ebiggers@google.com> > --- > security/Kconfig.hardening | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening > index 53baa95cb644..aad16187148c 100644 > --- a/security/Kconfig.hardening > +++ b/security/Kconfig.hardening > @@ -280,7 +280,8 @@ config ZERO_CALL_USED_REGS > endmenu > > config CC_HAS_RANDSTRUCT > - def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) > + # Temporarily disabled due to https://github.com/llvm/llvm-project/issues/60349 > + def_bool n > > choice > prompt "Randomize layout of sensitive kernel structures" > > base-commit: 7b753a909f426f2789d9db6f357c3d59180a9354 > -- > 2.39.1 This should be fixed with greater precision -- i.e. this is nearly fixed in Clang now, and is likely to be backported. So I think we'll need versioned checks here.
On Sat, Feb 4, 2023 at 11:06 AM Kees Cook <keescook@chromium.org> wrote: > > On Fri, Feb 03, 2023 at 11:42:01AM -0800, Eric Biggers wrote: > > From: Eric Biggers <ebiggers@google.com> > > > > Randstruct with clang is currently unsafe to use in any clang release > > that supports it, due to a clang bug that is causing miscompilations: > > "-frandomize-layout-seed inconsistently randomizes all-function-pointers > > structs" (https://github.com/llvm/llvm-project/issues/60349). Disable > > it temporarily until the bug is fixed and the fix is released in a clang > > version that can be checked for. > > > > Fixes: 035f7f87b729 ("randstruct: Enable Clang support") > > Cc: stable@vger.kernel.org > > Signed-off-by: Eric Biggers <ebiggers@google.com> > > --- > > security/Kconfig.hardening | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening > > index 53baa95cb644..aad16187148c 100644 > > --- a/security/Kconfig.hardening > > +++ b/security/Kconfig.hardening > > @@ -280,7 +280,8 @@ config ZERO_CALL_USED_REGS > > endmenu > > > > config CC_HAS_RANDSTRUCT > > - def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) > > + # Temporarily disabled due to https://github.com/llvm/llvm-project/issues/60349 > > + def_bool n > > > > choice > > prompt "Randomize layout of sensitive kernel structures" > > > > base-commit: 7b753a909f426f2789d9db6f357c3d59180a9354 > > -- > > 2.39.1 > > This should be fixed with greater precision -- i.e. this is nearly fixed > in Clang now, and is likely to be backported. So I think we'll need > versioned checks here. > > -- > Kees Cook > Bill has requested cherry-pick the llvm-project fix into the release/16.x branch [1]. https://github.com/llvm/llvm-project-release-prs/pull/276 It may take one day to land. [1]: https://github.com/llvm/llvm-project/tree/release/16.x
On Mon, Feb 6, 2023 at 3:41 PM Fangrui Song <maskray@google.com> wrote: > > On Sat, Feb 4, 2023 at 11:06 AM Kees Cook <keescook@chromium.org> wrote: > > > > On Fri, Feb 03, 2023 at 11:42:01AM -0800, Eric Biggers wrote: > > > From: Eric Biggers <ebiggers@google.com> > > > > > > Randstruct with clang is currently unsafe to use in any clang release > > > that supports it, due to a clang bug that is causing miscompilations: > > > "-frandomize-layout-seed inconsistently randomizes all-function-pointers > > > structs" (https://github.com/llvm/llvm-project/issues/60349). Disable > > > it temporarily until the bug is fixed and the fix is released in a clang > > > version that can be checked for. > > > > > > Fixes: 035f7f87b729 ("randstruct: Enable Clang support") > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Eric Biggers <ebiggers@google.com> > > > --- > > > security/Kconfig.hardening | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening > > > index 53baa95cb644..aad16187148c 100644 > > > --- a/security/Kconfig.hardening > > > +++ b/security/Kconfig.hardening > > > @@ -280,7 +280,8 @@ config ZERO_CALL_USED_REGS > > > endmenu > > > > > > config CC_HAS_RANDSTRUCT > > > - def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) > > > + # Temporarily disabled due to https://github.com/llvm/llvm-project/issues/60349 > > > + def_bool n > > > > > > choice > > > prompt "Randomize layout of sensitive kernel structures" > > > > > > base-commit: 7b753a909f426f2789d9db6f357c3d59180a9354 > > > -- > > > 2.39.1 > > > > This should be fixed with greater precision -- i.e. this is nearly fixed > > in Clang now, and is likely to be backported. So I think we'll need > > versioned checks here. > > > > -- > > Kees Cook > > > > Bill has requested cherry-pick the llvm-project fix into the > release/16.x branch [1]. > https://github.com/llvm/llvm-project-release-prs/pull/276 > It may take one day to land. > > [1]: https://github.com/llvm/llvm-project/tree/release/16.x > > -- > 宋方睿 > All landed; the version check should be for 16+. (And the link to the issue report would be nice to retain).
On Tue, Feb 07, 2023 at 10:01:21AM -0800, Nick Desaulniers wrote: > On Mon, Feb 6, 2023 at 3:41 PM Fangrui Song <maskray@google.com> wrote: > > > > On Sat, Feb 4, 2023 at 11:06 AM Kees Cook <keescook@chromium.org> wrote: > > > > > > On Fri, Feb 03, 2023 at 11:42:01AM -0800, Eric Biggers wrote: > > > > From: Eric Biggers <ebiggers@google.com> > > > > > > > > Randstruct with clang is currently unsafe to use in any clang release > > > > that supports it, due to a clang bug that is causing miscompilations: > > > > "-frandomize-layout-seed inconsistently randomizes all-function-pointers > > > > structs" (https://github.com/llvm/llvm-project/issues/60349). Disable > > > > it temporarily until the bug is fixed and the fix is released in a clang > > > > version that can be checked for. > > > > > > > > Fixes: 035f7f87b729 ("randstruct: Enable Clang support") > > > > Cc: stable@vger.kernel.org > > > > Signed-off-by: Eric Biggers <ebiggers@google.com> > > > > --- > > > > security/Kconfig.hardening | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening > > > > index 53baa95cb644..aad16187148c 100644 > > > > --- a/security/Kconfig.hardening > > > > +++ b/security/Kconfig.hardening > > > > @@ -280,7 +280,8 @@ config ZERO_CALL_USED_REGS > > > > endmenu > > > > > > > > config CC_HAS_RANDSTRUCT > > > > - def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) > > > > + # Temporarily disabled due to https://github.com/llvm/llvm-project/issues/60349 > > > > + def_bool n > > > > > > > > choice > > > > prompt "Randomize layout of sensitive kernel structures" > > > > > > > > base-commit: 7b753a909f426f2789d9db6f357c3d59180a9354 > > > > -- > > > > 2.39.1 > > > > > > This should be fixed with greater precision -- i.e. this is nearly fixed > > > in Clang now, and is likely to be backported. So I think we'll need > > > versioned checks here. > > > > > > -- > > > Kees Cook > > > > > > > Bill has requested cherry-pick the llvm-project fix into the > > release/16.x branch [1]. > > https://github.com/llvm/llvm-project-release-prs/pull/276 > > It may take one day to land. > > > > [1]: https://github.com/llvm/llvm-project/tree/release/16.x > > > > -- > > 宋方睿 > > > > All landed; the version check should be for 16+. (And the link to the > issue report would be nice to retain). Thanks! Done in "[PATCH] randstruct: disable Clang 15 support" (https://lore.kernel.org/linux-hardening/20230208065133.220589-1-ebiggers@kernel.org). - Eric
diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index 53baa95cb644..aad16187148c 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -280,7 +280,8 @@ config ZERO_CALL_USED_REGS endmenu config CC_HAS_RANDSTRUCT - def_bool $(cc-option,-frandomize-layout-seed-file=/dev/null) + # Temporarily disabled due to https://github.com/llvm/llvm-project/issues/60349 + def_bool n choice prompt "Randomize layout of sensitive kernel structures"