Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp401329rdh; Tue, 19 Dec 2023 02:19:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEspIPkE1l69M96dZcsl711PQuVQKyywEHzi1+53Uj1NtTPSUelrL4yaCOenaONyfoHyvq1 X-Received: by 2002:a05:6808:f10:b0:3b9:e632:50b3 with SMTP id m16-20020a0568080f1000b003b9e63250b3mr22893497oiw.41.1702981197067; Tue, 19 Dec 2023 02:19:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702981197; cv=none; d=google.com; s=arc-20160816; b=JRM0Kj1t6vxO7GWDd5R4NTyWqciLf/qBE9XnguSLxKRE5XpNubQqNwSxSzl5ds6qho HLQf/wIFMQy5E6eM0ZETCYKI3D9McQ/QiYtonRytFdc2KD95MzJulc7+G+bnlHPle4JO 575aPI2+iHOYlcr7qfHFEKRYIiwWiMOBO04MUsLNdX3q67H0Jty9abi3hukchOJ76moP +/sfclVm3bac37foN77Chapg/nccQ/Kw6WVkdIhPHIcdSg9XCjkiPqpBdawG1sEy7RFV xs7V05A5JuHdm9KDfEHN+TuDIMJG10Jgq97+G9KfZAbQswqoWht36tiKc1sILytGASLl +3+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=LWYyWkDsY/Zi8FphFf+H4zFoydBDiorSz1khQkPdMEE=; fh=qils7jx8Wi7YRQFAAXSQY402vddwnew3n+kWToHyBws=; b=vOuBN1Nf2kTbQ5sNzF36gTY/zJORD3mmmrTSYsvKBkAWv7Ol7S4oydwUj2W9Ny50DV rsbUclyk+Esn9b602ob81rqyJ1SJGAsecUK4BvFa5e9mfYnoQf8RmEhZerFtOAP8VAkh OD6v4ZSAgCHF2wZAZ95yppcxczBQxq5ilBCTYM+qM3lCRjVm4KDnKWoapl7t6oVwT9lZ QmqEkmGOWQMZUqVx9niW0mwFE5f5uBY23camY74yHoI0XpcjAQbrwPr09420+bPRqUMP UpU88cabspltzdhF3eCNnvzUSQnskIpzdSZYEpo+qUL+j5uhsxNYZ1bPEyOGoTqxfGwT kd4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b="mb/useEv"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LF1Xkp2v; spf=pass (google.com: domain of linux-kernel+bounces-4330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g22-20020a0caad6000000b0067f340d32b6si5816732qvb.199.2023.12.19.02.19.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 02:19:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b="mb/useEv"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LF1Xkp2v; spf=pass (google.com: domain of linux-kernel+bounces-4330-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CD4DC1C22EEA for ; Mon, 18 Dec 2023 20:12:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10CC172066; Mon, 18 Dec 2023 20:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="mb/useEv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="LF1Xkp2v" X-Original-To: linux-kernel@vger.kernel.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB9BD495DE; Mon, 18 Dec 2023 20:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B69CA5C020B; Mon, 18 Dec 2023 15:12:25 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 18 Dec 2023 15:12:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1702930345; x=1703016745; bh=LWYyWkDsY/Zi8FphFf+H4zFoydBDiorSz1khQkPdMEE=; b= mb/useEvR5Rr6NLotqJE7xJWNLJ+871ZGy2/uYtuW2wQXO4yYeUTVbM0SsBzoj0r CzGNA7FvC0317zUMQnG6wLHyTcPZdpmpSSHQCi7sEgM1nTWuk8DpTkQSrtUrwfz2 Ih7R0NjNdsj8fZ2CT0HzxSuaqNB2a/9Z5IwFFR5lJIm4TZHt7WpRbqupcfWk+flg hLIzRnHovyAEpOu9WtoLABYKqYR7Y0CXXqmZIldqSaRaTix89BeZTc8sxEWnjycc Szx0VnfX3lvp9K9yPvWFh5v0nX5cFfN8FrvZ3x8fAspjwEm2u/6gURTjdQix3Z6w 6FJnphYvBziTP5qGbFYYaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1702930345; x= 1703016745; bh=LWYyWkDsY/Zi8FphFf+H4zFoydBDiorSz1khQkPdMEE=; b=L F1Xkp2vIwgqV/4OdisyCGMQFVTW5IFoaaqJj3kCayBQNrYZM9ndbo+Y9cmAmjwcx pbbFhfdrnZqf/fzmntpD/WaxjdiGgE8nMhJbjvvzVnmJl4ijveL5KGerpFgWMNJU Are/Hdy33E1sKsJ0S4ythvV85FNpLYyD8n5+bp4mW7zFAOKZBEe824d0YIuYXtgQ 0ChzimvOs/bpWkN+6D/6YZymwuFEBu+yLOcsFZ0JVCAEapToQ0FETVfpOKt+utHM WmEwpFVZ6QkZMZEy8TptfwHDwJf0XtfeC1Ejti5cCaoJc3wMZ013i+NlGX2A8oea gB9EEedZVnqrgai433oBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtkedgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedf tehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrf grthhtvghrnhepgfekueelgeeigefhudduledtkeefffejueelheelfedutedttdfgveeu feefieegnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2CAD3B6008D; Mon, 18 Dec 2023 15:12:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1283-g327e3ec917-fm-20231207.002-g327e3ec9 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <0877a767-dea5-4c49-8125-d1995ef55407@app.fastmail.com> In-Reply-To: <20231218-net-skbuff-build-bug-v1-1-eefc2fb0a7d3@weissschuh.net> References: <20231218-net-skbuff-build-bug-v1-1-eefc2fb0a7d3@weissschuh.net> Date: Mon, 18 Dec 2023 20:12:07 +0000 From: "Arnd Bergmann" To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Simon Horman" Cc: Netdev , linux-kernel@vger.kernel.org, "kernel test robot" , stable@vger.kernel.org Subject: Re: [PATCH] net: avoid build bug in skb extension length calculation Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Dec 18, 2023, at 17:06, Thomas Wei=C3=9Fschuh wrote: > GCC seems to incorrectly fail to evaluate skb_ext_total_length() at > compile time under certain conditions. > > The issue even occurs if all values in skb_ext_type_len[] are "0", > ruling out the possibility of an actual overflow. > > As the patch has been in mainline since v6.6 without triggering the > problem it seems to be a very uncommon occurrence. > > As the issue only occurs when -fno-tree-loop-im is specified as part of > CFLAGS_GCOV, disable the BUILD_BUG_ON() only when building with covera= ge > reporting enabled. > > Reported-by: kernel test robot > Closes:=20 > https://lore.kernel.org/oe-kbuild-all/202312171924.4FozI5FG-lkp@intel.= com/ > Suggested-by: Arnd Bergmann > Link:=20 > https://lore.kernel.org/lkml/487cfd35-fe68-416f-9bfd-6bb417f98304@app.= fastmail.com/ > Fixes: 5d21d0a65b57 ("net: generalize calculation of skb extensions=20 > length") > Cc: > Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Arnd Bergmann > --- > net/core/skbuff.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 83af8aaeb893..94cc40a6f797 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -4825,7 +4825,9 @@ static __always_inline unsigned int=20 > skb_ext_total_length(void) > static void skb_extensions_init(void) > { > BUILD_BUG_ON(SKB_EXT_NUM >=3D 8); > +#if !IS_ENABLED(CONFIG_KCOV_INSTRUMENT_ALL) > BUILD_BUG_ON(skb_ext_total_length() > 255); > +#endif The way I would write this is BUILD_BUG_ON(!IS_ENABLED(CONFIG_KCOV_INSTRUMENT_ALL) && skb_ext_total_length() > 255); but of course the effect is the same. Arnd