lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <758dcdea-a75e-4888-891e-9f0b0f8481c1@redhat.com>
Date: Fri, 21 Mar 2025 10:11:04 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: netdev@...r.kernel.org, Willem de Bruijn
 <willemdebruijn.kernel@...il.com>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Simon Horman <horms@...nel.org>, David Ahern <dsahern@...nel.org>,
 kuniyu@...zon.com
Subject: Re: [PATCH v4 net-next 2/2] udp_tunnel: use static call for GRO hooks
 when possible

On 3/21/25 5:16 AM, Nathan Chancellor wrote:
[...]
>> +#define UDP_MAX_TUNNEL_TYPES (IS_ENABLED(CONFIG_GENEVE) + \
>> +			      IS_ENABLED(CONFIG_VXLAN) * 2 + \
>> +			      IS_ENABLED(CONFIG_NET_FOU) * 2)
> 
> I am seeing a warning in one particular configuration in my matrix when
> building with clang:
> 
>   $ make -skj"$(nproc)" ARCH=mips LLVM=1 mrproper malta_defconfig net/ipv4/udp_offload.o
>   net/ipv4/udp_offload.c:130:8: warning: array index 0 is past the end of the array (that has type 'struct udp_tunnel_type_entry[0]') [-Warray-bounds]
>     130 |                                    udp_tunnel_gro_types[0].gro_receive);

[...]

> GCC is more noisy but -Warray-bounds is not on by default yet.
> 
>   $ make -skj"$(nproc)" ARCH=mips CROSS_COMPILE=mips-linux- KCFLAGS=-Warray-bounds mrproper malta_defconfig net/ipv4/udp_offload.o
>   In function 'udp_tunnel_update_gro_rcv',
>       inlined from 'udp_tunnel_update_gro_rcv' at net/ipv4/udp_offload.c:78:6:
>   net/ipv4/udp_offload.c:125:44: warning: array subscript <unknown> is outside array bounds of 'struct udp_tunnel_type_entry[0]' [-Warray-bounds=]
>     125 |                 *cur = udp_tunnel_gro_types[--udp_tunnel_gro_type_nr];
>         |                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

[...]

> Should UDP_MAX_TUNNEL_TYPES be at least 1?

Indeed! thank you for reporting.

I'll send a patch soon. I must admit I did not expect NET_UDP_TUNNEL
enabled without any of vxlan, geneve and xfrm, but such configuration is
indeed possible.

Thanks,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ