From: Antoine Tenart <atenart@kernel.org>
To: davem@davemloft.net, edumazet@google.com,
kernel test robot <lkp@intel.com>,
kuba@kernel.org, pabeni@redhat.com
Cc: oe-kbuild-all@lists.linux.dev, steffen.klassert@secunet.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net 1/4] udp: do not accept non-tunnel GSO skbs landing in a tunnel
Date: Mon, 18 Mar 2024 11:03:40 +0100 [thread overview]
Message-ID: <171075622074.25781.8502242285616689318@kwain> (raw)
In-Reply-To: <202403160519.XghWVi81-lkp@intel.com>
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@intel.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)))
next prev parent reply other threads:[~2024-03-18 10:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 15:17 [PATCH net 0/4] gro: various fixes related to UDP tunnels Antoine Tenart
2024-03-15 15:17 ` [PATCH net 1/4] udp: do not accept non-tunnel GSO skbs landing in a tunnel Antoine Tenart
2024-03-15 21:21 ` kernel test robot
2024-03-18 10:03 ` Antoine Tenart [this message]
2024-03-15 21:43 ` kernel test robot
2024-03-16 14:05 ` Willem de Bruijn
2024-03-15 15:17 ` [PATCH net 2/4] gro: fix ownership transfer Antoine Tenart
2024-03-16 15:25 ` Willem de Bruijn
2024-03-18 9:09 ` Antoine Tenart
2024-03-15 15:17 ` [PATCH net 3/4] udp: do not transition UDP fraglist to unnecessary checksum Antoine Tenart
2024-03-15 15:17 ` [PATCH net 4/4] udp: prevent local UDP tunnel packets from being GROed Antoine Tenart
2024-03-16 15:43 ` Willem de Bruijn
2024-03-18 8:43 ` Antoine Tenart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=171075622074.25781.8502242285616689318@kwain \
--to=atenart@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).