Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1500753rwi; Wed, 19 Oct 2022 11:21:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uT6Pu7hHJpZybS4c/8s0eXXTJyPRpV/TDKp8kObjA9FV/k2nxgfiprEQ1RP7D3HVMe5A0 X-Received: by 2002:a17:902:a502:b0:180:e637:a934 with SMTP id s2-20020a170902a50200b00180e637a934mr9922258plq.64.1666203699757; Wed, 19 Oct 2022 11:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666203699; cv=none; d=google.com; s=arc-20160816; b=t00lX0PXOP4GS4MEa6jIkxuveoSTIo4blat/XU85Giix6THQa5BhtPKpIQNS0/tTsb X3+RGIf/ROQHpJvIeLq4Qnb4AoaWIYfnEznahenhCzm2ZczTJR4Q+ibRr3AwDvaebUk8 xGZyLs6sb+TLC0HOrMkgvyOCSWJTbxt2G5FTcjcQY7CuiSz31ijexnyMl8F+GiwsS3EF 4yRCiu/vM+SsyRcty+1eI1MxNesvHFRKbnAUhwspSOTArsbgsOVkKr91QC76WRSzhTDp UfZCqDFIS2SkT/BWW2rnH2VYIBc3m3w5oI1XwelQD9jdLt4v+t/+Bc8bTzcgwJKiv0mn p34A== 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=BFRWd7vrrVi87eI0lxP0gM69HCWszoFdIqs2so5GqDM=; b=eXFiLQjTKpiTPt3IXFOk04KtZOpzmmQjALUEZYX8V5W+HzNHWzs+Jx+uE3vT5HTWWY wIEf1t6NZe3/Xo7Va6BtwsubqquLb9djBkFq0sp+8NLUhjK3gof7Ngpx+X/sOrH1atpW 7d9Iiy9gL7DsP5GEUuNgOlqq+qjIVGdQM4KglIJN7j5HlL4/2ksQNHMtj70/Vopj/bQJ oI89kzpRG9gcHA3vhw5wzfh226GOULGshakQic71WpUttU0dpuLu6hLNDUxkJLkWJJ0P QEUxgXjwyC/W0la5Tu1ziyS7k3cGzaNI3wnWgWIEGhFyPmU43xLAwZXsDc79PJk95GST yhKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PLA2JsXS; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a170903228100b00176a0d8780csi23529275plh.285.2022.10.19.11.21.27; Wed, 19 Oct 2022 11:21:39 -0700 (PDT) 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=@chromium.org header.s=google header.b=PLA2JsXS; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbiJSRbB (ORCPT + 99 others); Wed, 19 Oct 2022 13:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbiJSRa5 (ORCPT ); Wed, 19 Oct 2022 13:30:57 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FFEE2F66B for ; Wed, 19 Oct 2022 10:30:56 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id y8so17846521pfp.13 for ; Wed, 19 Oct 2022 10:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BFRWd7vrrVi87eI0lxP0gM69HCWszoFdIqs2so5GqDM=; b=PLA2JsXSqysIna9tFsBBdRao1dBwSMRZlrn2O4ICeRbBe5gsyCf5q5bEFsXF9vUtDX TXaCAoVe7QSjqWw121MB5fezIxVesfDN6kE6K2l9eCB6P2R3rsBFsysJJ6uhkRiwxJKQ NO7mHzl2sjp2PXwq4CHkGWD8d8/TFlfObI96g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BFRWd7vrrVi87eI0lxP0gM69HCWszoFdIqs2so5GqDM=; b=QMkOiPzbMcYATO0TVMMDfFqAYsr0d9+ODMhwUikCdv9BnuY28SUQw6BatIp6j+mNJA pJjEJ5k0cR/5rHqW3MctMydrkbgU+uTPsOKe++F4eZQTOBEtxhe8aoZOaf7zFMm+jX9G KVf5jZhLQ+ClER92NjtjRu3xcVhsU9CNaxKwjTo5PRluqoGOXMtLuklVgOiO9/XyomaN a4TImKh2526o5dzbT9VAPzuJKL7Y1JNnlt7unwNraLeVnbUHtcIFLHbic01hI1g3VkPV n5+9hLMbU+Op6zObUxfBNkhxskjqBqTKYe1VlOKHQa7/2kgk4j6+Y3TwtRVw8rBpCK9i CuVA== X-Gm-Message-State: ACrzQf1ETIveKOda4EQC6oUVV5+o72eMWqI/MCbiPhvaREhNp9V7YHOL b0c6PP9QCmDaGIOBWJKypGzEAg== X-Received: by 2002:a63:4a41:0:b0:452:bab5:156a with SMTP id j1-20020a634a41000000b00452bab5156amr8132651pgl.486.1666200655754; Wed, 19 Oct 2022 10:30:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c3-20020a170902d48300b00178b6ccc8a0sm11073833plg.51.2022.10.19.10.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 10:30:55 -0700 (PDT) Date: Wed, 19 Oct 2022 10:30:54 -0700 From: Kees Cook To: Alexander Potapenko Cc: Nathan Chancellor , Andrew Morton , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kasan-dev@googlegroups.com, linux-mm@kvack.org Subject: Re: -Wmacro-redefined in include/linux/fortify-string.h Message-ID: <202210191030.EC5C138E@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 19, 2022 at 09:48:27AM -0700, Alexander Potapenko wrote: > On Wed, Oct 19, 2022 at 8:37 AM Nathan Chancellor wrote: > > > > Hi all, > > > > I am seeing the following set of warnings when building an x86_64 > > configuration that has CONFIG_FORTIFY_SOURCE=y and CONFIG_KMSAN=y: > > I was also looking into this issue recently, because people start > running into it: https://github.com/google/kmsan/issues/89 > > I have a solution that redefines __underlying_memXXX to __msan_memXXX > under __SANITIZE_MEMORY__ in fortify-string.h and skips `#define > memXXX __msan_memXXX` in string_64.h, making KMSAN kinda work with > FORTIFY_SOURCE. Oh good! > Dunno if that's necessary though: KMSAN is a debugging tool anyway, > and supporting it in fortify-string.h sounds excessive. I'd much prefer letting them still work together. -- Kees Cook