]> git.dujemihanovic.xyz Git - linux.git/commit
net: avoid build bug in skb extension length calculation
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 18 Dec 2023 17:06:54 +0000 (18:06 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 Dec 2023 07:09:40 +0000 (08:09 +0100)
commitd6e5794b06c0fab74fe6e4fa55d508a5ceb14735
tree6c1f8de90179044dfee57ad594f34e4d42c8548c
parent7cb8cd4daacfea646cf8b5925ca2c66c98b18480
net: avoid build bug in skb extension length calculation

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 coverage
reporting enabled.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312171924.4FozI5FG-lkp@intel.com/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/lkml/487cfd35-fe68-416f-9bfd-6bb417f98304@app.fastmail.com/
Fixes: 5d21d0a65b57 ("net: generalize calculation of skb extensions length")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231218-net-skbuff-build-bug-v1-1-eefc2fb0a7d3@weissschuh.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/skbuff.c