Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3206070rdb; Thu, 16 Nov 2023 03:24:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTf8xViWpNHkGac+x9gZYnho9vae4TdwemoVThiLYDJrUbcGgrnJ9la35E5SkDK5GHTPsI X-Received: by 2002:a17:90b:4c0f:b0:27d:1df4:26f3 with SMTP id na15-20020a17090b4c0f00b0027d1df426f3mr14859383pjb.15.1700133868949; Thu, 16 Nov 2023 03:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700133868; cv=none; d=google.com; s=arc-20160816; b=RHmAVu/aOso9JtsXFxO4njb34HL0l8FL/Bnm5bTx6ETwBR4neNRri1MpIGr451cOep xanwx4/LPO2RDxg42b89Zd5jsERUNmy+4Iyrf2udQzSh9NLXFh1barqecm0ZiRT66Ibg 9oufbtnvI7csSWJ7av0HYdgPVU3OrwlqrXLPFYdhV0W+D1WHWQHUkHAtFtdEBJo17fB/ I3lueJVgy9WNICovjlMeIyLyvQtWsnXAkRdSekgUD+hOVwapaFX3Wc0i1T4RlP7LT62Q vc5OAIvJySlcFKo3RlbH0Z6VDIsYKfQFf9g9Owxv6pvYdcTppgKPH2XxH8J8jFh1v/y5 wAJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ht/W71d5P/1BL6NVsirmihihBj4oWOwsJ8E+W9bBv3Q=; fh=PTHBECxDQfbp9LKp8nLUvoGUoN2qw9Or2XjesmLa83c=; b=AE1NQNnl1ltyhqMNbrrEtYYcxbBxLIJPBNaUZLvl6M6e4ZIXWmhirObT+aGQWOs88D Nn8DoQxng1T8oG2ielZTc6IKFPK7zkCbFV5pDw0uK1kG4d3KleUv+haMtItx8poCsaul 6Yt0nITT8OsCZ2lKG4KczTcynJ2e/WMksmHmBCaxNEcZFhbK84SDPl+CpcHWt0FZ3dT8 IowNebqGGH7XMyuT03pgxUQH8lQ0zAlQYLUBsunnGXLEfw4tepwF8oiQOkEXkkQaVJ6f 9Hs4/ZM9PxPaAdYQTLKl2WM0dVPD3k1Y0NZpkTZ79P6005ksmlmVrypFe9eEOEl9M7MB vySg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RgfqziOi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id my17-20020a17090b4c9100b00276571c0d34si1968673pjb.6.2023.11.16.03.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 03:24:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RgfqziOi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3EB6480F649A; Thu, 16 Nov 2023 03:24:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344966AbjKPLYT (ORCPT + 99 others); Thu, 16 Nov 2023 06:24:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbjKPLYS (ORCPT ); Thu, 16 Nov 2023 06:24:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15EB585 for ; Thu, 16 Nov 2023 03:24:15 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A38CBC433C8; Thu, 16 Nov 2023 11:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700133854; bh=bCJDoiy/sh3xNRf75ljpDp88pdpsa7M3K2V68jRgzUc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RgfqziOiMbINq8HsxM2OAWW6UCsAyV7XWuCw4XgE4yIDcKrLWhbVjO9zGgXUn/IBH Yzqen8E/CLSc5Cul2RCbpoWLUv8uPnAOaUvzFxm1HFdkAqy5Jio0nGKgkbONaVaPGc HApbsRDtLrGaVQd5J0jT4nYKDfn18zREeuLVcXuB6xBn3CdYLmoC9lY8C3sQCuU8tv Ayh8grmY4D7wuuSAjZN2fZ++x+zglxTbv/p5DaeHnqL7dOoZuBf1B1LuTlSLaKr6ob ZLKQqew/+zPbTioOFky+qHOuyOg9/KU/95hzlBHScr0JfB47lvdRZdnoLLe/YLrzYD W9GAJA/RQukmw== Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-1ea82246069so303969fac.3; Thu, 16 Nov 2023 03:24:14 -0800 (PST) X-Gm-Message-State: AOJu0YwC9MFCFjzpw6m4RRNAoj8Ho8ZfaObjEL1FdOOUpnvO1er1SJua gLr2V+n4mtzCFm6GfJrab+0CNxZeQsRcjpo2N0g= X-Received: by 2002:a05:6870:648f:b0:1e9:bbfe:6457 with SMTP id cz15-20020a056870648f00b001e9bbfe6457mr21480433oab.6.1700133854051; Thu, 16 Nov 2023 03:24:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Masahiro Yamada Date: Thu, 16 Nov 2023 20:23:37 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH][next] Makefile: Enable -Wstringop-overflow globally To: "Gustavo A. R. Silva" Cc: Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 03:24:26 -0800 (PST) On Thu, Nov 16, 2023 at 12:27=E2=80=AFPM Gustavo A. R. Silva wrote: > > It seems that we have finished addressing all the remaining > issues regarding compiler option -Wstringop-overflow. So, we > are now in good shape to enable this compiler option globally. > > Signed-off-by: Gustavo A. R. Silva > --- > Makefile | 3 +++ > scripts/Makefile.extrawarn | 2 -- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 690cde550acd..452b7d0e19e9 100644 > --- a/Makefile > +++ b/Makefile > @@ -985,6 +985,9 @@ NOSTDINC_FLAGS +=3D -nostdinc > # perform bounds checking. > KBUILD_CFLAGS +=3D $(call cc-option, -fstrict-flex-arrays=3D3) > > +# We are now in good shape to enable this option. Please remove this comment. It it fine to mention it in the commit log, but not in the Makefile. I hope somebody will double-check this patch in CI infrastructure. > +KBUILD_CFLAGS +=3D $(call cc-option, -Wstringop-overflow) > + > # disable invalid "can't wrap" optimizations for signed / pointers > KBUILD_CFLAGS +=3D -fno-strict-overflow > > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn > index 2fe6f2828d37..1527199161d7 100644 > --- a/scripts/Makefile.extrawarn > +++ b/scripts/Makefile.extrawarn > @@ -106,7 +106,6 @@ KBUILD_CFLAGS +=3D $(call cc-option, -Wunused-const-v= ariable) > KBUILD_CFLAGS +=3D $(call cc-option, -Wpacked-not-aligned) > KBUILD_CFLAGS +=3D $(call cc-option, -Wformat-overflow) > KBUILD_CFLAGS +=3D $(call cc-option, -Wformat-truncation) > -KBUILD_CFLAGS +=3D $(call cc-option, -Wstringop-overflow) > KBUILD_CFLAGS +=3D $(call cc-option, -Wstringop-truncation) > > KBUILD_CPPFLAGS +=3D -Wundef > @@ -122,7 +121,6 @@ KBUILD_CFLAGS +=3D $(call cc-disable-warning, restric= t) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, packed-not-aligned) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, format-overflow) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, format-truncation) > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, stringop-overflow) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, stringop-truncation) > > ifdef CONFIG_CC_IS_CLANG > -- > 2.34.1 > --=20 Best Regards Masahiro Yamada