Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4720754pxv; Tue, 27 Jul 2021 14:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1yeHAqZBhpyT0Zqq6jad+vpDZZXXBxGWEEcDB1PZ2NW0Lf746nfCAgsykQ5v3IuCCAHaR X-Received: by 2002:a17:906:1685:: with SMTP id s5mr10435094ejd.370.1627422478241; Tue, 27 Jul 2021 14:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627422478; cv=none; d=google.com; s=arc-20160816; b=MWthvEqd9iJPtUxDeryRD8ZIk7O0Zw9DzgYjaajpbwlC/GeN+8+fv97VVa+bocjXM5 8PR47b33g+d1J0WgYiSGLHtwCLs69/22AGIacphnTkLPBApEFofgtzIrthIQF0KA5NX+ MdP6bBWBBoUUeHogfILpuqVLrhgxjPRpfoOi3F6D1r3ZxUID0CNgNHiFlSE8s2ol35y2 MiYaSwVbieKp7fjO+YMT9TpAqqUmzlV9rlYhzc6g5mZmFHQdDMuGlsenCy5XPk14jsuT FdEeUkFXiyQC6ErNggBhfNWYX+NDFhRl3c/4aPdu7MlQhyQ/JYXDfllHGq/e/WlDbFdt rRmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RmWu5L4XF1JSf6SMuIfCAjF4w7lZ2j3Pm51HCxVaooA=; b=fMzZAWHDduRVI7K+F+NHNLpVlex187D0dajU7EmZXB0G6WVPmVAkgCXTfxsShAa0Bb k8hXfq1Z8VCCEYfOhIirDSO3VPCB5Vk07TIIHOcLBzJdcN2Tcsv3G/GwyZej3IjJDi97 zvhMsHaqSEmONX85y+SP2Hrxywc60fQhmLfgvcnB2o6OnMii1TngreCUqMkxIzerWPGV AXsi6J7kCsnzs3hl+9/qymwZgp36RI4i+0O/m+hrM+uhJXl/iRXWH1XwDNzZbW8Iu0QK 2852FgFLiWJ1kj+zUqS+jcxgeDEIc4QXzlbOJbjMbpCcSfN0NlJ8zoGbt0YULoQh4kSP kNGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kT5nbH7Q; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si494567eju.161.2021.07.27.14.47.35; Tue, 27 Jul 2021 14:47:58 -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=@chromium.org header.s=google header.b=kT5nbH7Q; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbhG0Vr2 (ORCPT + 99 others); Tue, 27 Jul 2021 17:47:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbhG0Vr0 (ORCPT ); Tue, 27 Jul 2021 17:47:26 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E65DC0613D3 for ; Tue, 27 Jul 2021 14:47:25 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id i10so153001pla.3 for ; Tue, 27 Jul 2021 14:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RmWu5L4XF1JSf6SMuIfCAjF4w7lZ2j3Pm51HCxVaooA=; b=kT5nbH7QT643iQGqVSJxPNGwwBlfdxw5cCyQX6gaBzOcqz4ajIPGMOczsYHolmn62d eW8ICZNFrJ1d3HiFUcApnGkXgvWlWnUUGLsdAOvKSLOBSwaj/BB+s0Fa9Bal55XOCrIt E/hihwg5GtX2PF8wCIvqM4CT8+GGunjYl5M0k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RmWu5L4XF1JSf6SMuIfCAjF4w7lZ2j3Pm51HCxVaooA=; b=NqtIV0j94REUJIeCGVL7PPDVPhtqOu6xt5xUmCQIFhAQx3r7n+NipabP+1DFBT/EMt QaYBe+sKgOwI8vZJ7QxSrCavoCQ3Yk6J1qhNFx/MF//mgY559gdfB5Ks9Igp8VrJdiOi i9GPsp8YCBuKq1/5i3WeVY9+LBCKDAFZjF56WpA5o37Jbp3PYK4J1bl3jWHSteM+Phpn ifvvI3qRQqhIlL+dN12898Jd0bF23yQKNgQFoWnfJyfqCdRGiHcIYCItI5NxaFT1ULJf pvjdSddgs/flOhbWg/KC9fZuJ4YSLWcn7W0b7GHQPvQbbq6x5TXpoD51kEPeverSK9ju 0tzg== X-Gm-Message-State: AOAM530JAJNOftOJ5YDnFAIO1S1aplcS78pnrH3MjgGhooKKEoILe23u 61eCmWqed8Wyg5HV0UbFE1+pTw== X-Received: by 2002:a17:902:a513:b029:11a:9be6:f1b9 with SMTP id s19-20020a170902a513b029011a9be6f1b9mr20025348plq.55.1627422444596; Tue, 27 Jul 2021 14:47:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t37sm4805774pfg.14.2021.07.27.14.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 14:47:23 -0700 (PDT) Date: Tue, 27 Jul 2021 14:47:22 -0700 From: Kees Cook To: Nathan Chancellor Cc: linux-hardening@vger.kernel.org, "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 Subject: Re: [PATCH 31/64] fortify: Explicitly disable Clang support Message-ID: <202107271434.039A9777@keescook> References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-32-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Jul 27, 2021 at 02:18:58PM -0700, Nathan Chancellor wrote: > 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 :) /me shakes fist at sky Thank you! Fixed locally. :) -Kees > > > help > > Detect overflows of buffers in common string and memory functions > > where the compiler can determine and validate the buffer sizes. > > > > Cheers, > Nathan -- Kees Cook