Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4707002pxv; Tue, 27 Jul 2021 14:20:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIWkIYvezqW+B720RpwqLMiy0s9XTZa4jnI3G247gd3uWOS5O/BL/mLLKH3wW++EXtpx/l X-Received: by 2002:a17:906:1fd3:: with SMTP id e19mr16761468ejt.421.1627420844775; Tue, 27 Jul 2021 14:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627420844; cv=none; d=google.com; s=arc-20160816; b=ldG7ci3Zch0Os4u1nOJKQp7uzKq9qgxuXCDLF6Kht7Xg3mdvoC9WpTzPUFR3FsgChw gptCGITUe/FjeejWDzTigbZdE9k8WnW5rrkeI+Vl42JRFDYjGfWhmB5/uQzc0CO6UHTn Wcl2KJugo3oKkvGFsDqoreJtFY9hFi6TOFfNHeSWXVyaL3s4zzrH36a99ezip3V8jYX3 a//feqxvdEf0mpuTYskPSC5SORVBVjDLQo6ng1+dT5Tbk8DB3u2ByWeqiQZ5VC/bnTfi jN/DfHE6jFByR6nnceNFEBfuSWAss9cAvq2Twz9GHwwP6szyGdugBS4AVBl2NeyPtO3W 2vvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GtpDDehDSn+lirR/aQByXLY6ZwwQ30qwrpGWGeT54Jc=; b=GiYcbrzZL9o0wIUWAnD/xJaeo9Aqr8pFem1krAqGXIBOFFJnyHVCvJkRUpK3EyMQc/ p0h5MfCbDdoP3mQ0AOB3503GdtDAPh6ipa/nwgDNegZQeycAnf+4YUzDkZozVGops8H1 8R/XupP5DxV3id5MRcu8+HfKPsqFkRIVZ5r5VkdPFkipNTHV/xTasXhTSCZ/iRZ3qOHb aYZiYpoLu7jW4nLbdAIoTT43gpA0MWjJYcZf6EDxiIDrGlNx8XklT+sV3pbKt9E1EGgl jGeWcGtHR0Lt9MGsZ3XKFVSNQPjWEcY8Y8DLuw9AC8w3W844iydYC5gDG+53tF2Pr/uM uDMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yhxrd8TF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 hr1si5353458ejc.424.2021.07.27.14.20.21; Tue, 27 Jul 2021 14:20:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=Yhxrd8TF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S234997AbhG0VUJ (ORCPT + 99 others); Tue, 27 Jul 2021 17:20:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234113AbhG0VT3 (ORCPT ); Tue, 27 Jul 2021 17:19:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C5BA60FA0; Tue, 27 Jul 2021 21:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627420740; bh=WmBPx1Yv944WSgHzak0rUdbiFwHmXA9AEErppz095mw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Yhxrd8TFAkXrlR9r4ZRtp1p0sOIsB3ZuHtZ7oYU4pXZvEaqyymH79DJSjO7iRK0si GSkXTTyUofgJqP034jp+1ZTvpxMOzmU1ZGhjE0qTg4I6idDUP9ThURBnvBclsuNBhC u1tZ6C5YrfZBbxqk5ahpRO+VLSzVj3IEDOAgpOob/SggphKjlTaaTST/9JYGw9qJid 8957SpfZCeNiETD/zLB4cNWxzBDrGN9HQH+PNdMkwgJzIdpYFU/NFrV7mI6t8oFQsi iwRWwF/foCBjtefKMixR8I7lM2u4IUX+zsUkg8iCrC0hdyyEJdWn/XDDKg0i/Pt6xD FkiBVpBB37WQw== Subject: Re: [PATCH 31/64] fortify: Explicitly disable Clang support To: Kees Cook , linux-hardening@vger.kernel.org Cc: "Gustavo A. R. Silva" , Keith Packard , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-32-keescook@chromium.org> From: Nathan Chancellor Message-ID: Date: Tue, 27 Jul 2021 14:18:58 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210727205855.411487-32-keescook@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 7/27/2021 1:58 PM, Kees Cook wrote: > Clang has never correctly compiled the FORTIFY_SOURCE defenses due to > a couple bugs: > > Eliding inlines with matching __builtin_* names > https://bugs.llvm.org/show_bug.cgi?id=50322 > > Incorrect __builtin_constant_p() of some globals > https://bugs.llvm.org/show_bug.cgi?id=41459 > > In the process of making improvements to the FORTIFY_SOURCE defenses, the > first (silent) bug (coincidentally) becomes worked around, but exposes > the latter which breaks the build. As such, Clang must not be used with > CONFIG_FORTIFY_SOURCE until at least latter bug is fixed (in Clang 13), > and the fortify routines have been rearranged. > > Update the Kconfig to reflect the reality of the current situation. > > Signed-off-by: Kees Cook > --- > security/Kconfig | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/security/Kconfig b/security/Kconfig > index 0ced7fd33e4d..8f0e675e70a4 100644 > --- a/security/Kconfig > +++ b/security/Kconfig > @@ -191,6 +191,9 @@ config HARDENED_USERCOPY_PAGESPAN > config FORTIFY_SOURCE > bool "Harden common str/mem functions against buffer overflows" > depends on ARCH_HAS_FORTIFY_SOURCE > + # https://bugs.llvm.org/show_bug.cgi?id=50322 > + # https://bugs.llvm.org/show_bug.cgi?id=41459 > + depends on !CONFIG_CC_IS_CLANG Should be !CC_IS_CLANG, Kconfig is hard :) > help > Detect overflows of buffers in common string and memory functions > where the compiler can determine and validate the buffer sizes. > Cheers, Nathan