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]
Date: Mon, 18 Mar 2024 11:03:40 +0100
From: Antoine Tenart <atenart@...nel.org>
To: davem@...emloft.net, edumazet@...gle.com, kernel test robot <lkp@...el.com>, kuba@...nel.org, pabeni@...hat.com
Cc: oe-kbuild-all@...ts.linux.dev, steffen.klassert@...unet.com, netdev@...r.kernel.org
Subject: Re: [PATCH net 1/4] udp: do not accept non-tunnel GSO skbs landing in a tunnel

Quoting kernel test robot (2024-03-15 22:21:50)
> Hi Antoine,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on net/main]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Antoine-Tenart/udp-do-not-accept-non-tunnel-GSO-skbs-landing-in-a-tunnel/20240315-232048
> base:   net/main
> patch link:    https://lore.kernel.org/r/20240315151722.119628-2-atenart%40kernel.org
> patch subject: [PATCH net 1/4] udp: do not accept non-tunnel GSO skbs landing in a tunnel
> config: arc-defconfig (https://download.01.org/0day-ci/archive/20240316/202403160519.XghWVi81-lkp@intel.com/config)
> compiler: arc-elf-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240316/202403160519.XghWVi81-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202403160519.XghWVi81-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    arc-elf-ld: net/ipv4/udp.o: in function `udp_queue_rcv_skb':
> >> udp.c:(.text+0x3aca): undefined reference to `udpv6_encap_needed_key'
> >> arc-elf-ld: udp.c:(.text+0x3aca): undefined reference to `udpv6_encap_needed_key'

Issue is with CONFIG_IPV6=n. The following should fix it,

diff --git a/include/linux/udp.h b/include/linux/udp.h
index 51558d6527f0..05231fff8703 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -151,7 +151,22 @@ static inline void udp_cmsg_recv(struct msghdr *msg, struct sock *sk,
 }
 
 DECLARE_STATIC_KEY_FALSE(udp_encap_needed_key);
+#if IS_ENABLED(CONFIG_IPV6)
 DECLARE_STATIC_KEY_FALSE(udpv6_encap_needed_key);
+#endif
+
+static inline bool udp_encap_needed(void)
+{
+       if (static_branch_unlikely(&udp_encap_needed_key))
+               return true;
+
+#if IS_ENABLED(CONFIG_IPV6)
+       if (static_branch_unlikely(&udpv6_encap_needed_key))
+               return true;
+#endif
+
+       return false;
+}
 
 static inline bool udp_unexpected_gso(struct sock *sk, struct sk_buff *skb)
 {
@@ -170,8 +185,7 @@ static inline bool udp_unexpected_gso(struct sock *sk, struct sk_buff *skb)
         * land in a tunnel as the socket check in udp_gro_receive cannot be
         * foolproof.
         */
-       if ((static_branch_unlikely(&udp_encap_needed_key) ||
-            static_branch_unlikely(&udpv6_encap_needed_key)) &&
+       if (udp_encap_needed() &&
            READ_ONCE(udp_sk(sk)->encap_rcv) &&
            !(skb_shinfo(skb)->gso_type &
              (SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP_TUNNEL_CSUM)))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ