mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: littlesmilingcloud@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	dsahern@kernel.org, idosch@nvidia.com, andrew+netdev@lunn.ch,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 05/14] ip6_tunnel: add drop reasons to the receive path
Date: Sun, 04 Oct 2026 21:00:47 +0000	[thread overview]
Message-ID: <179114764714.434549.10541167690659165045@kernel.org> (raw)
In-Reply-To: <20260930183910.3151873-6-littlesmilingcloud@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In ipxip6_rcv() (net/ipv6/ip6_tunnel.c, line 978), every packet
  that ip6_tnl_rcv_ctl() refuses is now dropped with…

--

ip6_tunnel: add drop reasons to the receive path

This patch replaces the plain kfree_skb() calls in __ip6_tnl_rcv() and
ipxip6_rcv() with kfree_skb_reason(). Where possible it reuses the
reasons that ip_tunnel_rcv() and the length helpers already return. It
also gives the early drops in ipxip6_rcv() their own reasons.

> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
> index d5ff50a2ac017..52f6a38657b9f 100644
> --- a/net/ipv6/ip6_tunnel.c
> +++ b/net/ipv6/ip6_tunnel.c

[ ... ]

> @@ -952,21 +965,30 @@ static int ipxip6_rcv(struct sk_buff *skb, u8 ipproto,
>  	if (t) {
>  		u8 tproto = READ_ONCE(t->parms.proto);
>  
> -		if (tproto != ipproto && tproto != 0)
> +		if (tproto != ipproto && tproto != 0) {
> +			reason = SKB_DROP_REASON_UNHANDLED_PROTO;
>  			goto drop;
> -		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
> +		}
> +		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
> +			reason = SKB_DROP_REASON_XFRM_POLICY;
>  			goto drop;
> +		}
>  		ipv6h = ipv6_hdr(skb);
> -		if (!ip6_tnl_rcv_ctl(t, &ipv6h->daddr, &ipv6h->saddr))
> +		if (!ip6_tnl_rcv_ctl(t, &ipv6h->daddr, &ipv6h->saddr)) {
> +			reason = SKB_DROP_REASON_DEV_READY;
>  			goto drop;
> +		}

[Severity: Low]
Does SKB_DROP_REASON_DEV_READY fit any of the cases where
ip6_tnl_rcv_ctl() refuses a packet?

include/net/dropreason-core.h documents it as:

	 * @SKB_DROP_REASON_DEV_READY: the device is not ready to xmit/recv due to
	 * any of its data structure that is not up/ready/initialized,
	 * e.g., the IFF_UP is not set, or driver specific tun->tfiles[txq]
	 * is not initialized

ip6_tnl_rcv_ctl() does not look at device state. It returns 0 in three
cases:

  - the tunnel has neither IP6_TNL_F_CAP_RCV nor a per-packet capability
    that allows receive for these addresses
  - laddr is not multicast and is not a non-tentative local address
  - raddr is local and IP6_TNL_F_ALLOW_LOCAL_REMOTE is not set

The IFF_UP example cannot apply either. ip6_tnl_lookup() only returns
tunnels that are already up:

ip6_tnl_lookup() {
    ...
		    !(t->dev->flags & IFF_UP))
			continue;
    ...
}

So dropwatch, drop_monitor and BPF users of skb:kfree_skb would report
a misconfigured endpoint, a missing capability, or a spoofed or looped
source as a device readiness problem.

The commit message says DEV_READY "describes only the first" case and
leaves a proper split for a follow-up. The later patches "ip6_tunnel:
make ip6_tnl_xmit() return a drop reason" and "ip6_gre: add drop
reasons to the transmit path" use DEV_READY the same way for
ip6_tnl_xmit_ctl(). By the end of the series, the DEV_READY kernel-doc
is still unchanged, but the series does update the docs for
TUNNEL_INVALID_HDR, TUNNEL_NOT_FOUND and RECURSION_LIMIT.

Would it be better to widen the DEV_READY kernel-doc, or to add a
tunnel address/capability reason for these call sites?

> -		if (iptunnel_pull_header(skb, 0, tpi->proto, false))
> +		reason = iptunnel_pull_header(skb, 0, tpi->proto, false);
> +		if (reason)
>  			goto drop;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260930183910.3151873-1-littlesmilingcloud%40gmail.com

  parent reply	other threads:[~2026-10-04 21:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 18:38 [PATCH net-next v5 00/14] tunnels: add core and gre drop reasons Anton Danilov
2026-09-30 18:38 ` [PATCH net-next v5 01/14] vxlan: rename the drop reasons for use by other tunnels Anton Danilov
2026-09-30 18:38 ` [PATCH net-next v5 02/14] ip_tunnel: make __iptunnel_pull_header() return a drop reason Anton Danilov
2026-10-04 21:00   ` netdev-bot+sashiko
2026-09-30 18:38 ` [PATCH net-next v5 03/14] vxlan: report the drop reason of __iptunnel_pull_header() Anton Danilov
2026-09-30 18:39 ` [PATCH net-next v5 04/14] ip_tunnel: add drop reasons to the generic RX path Anton Danilov
2026-10-04 16:06   ` Ido Schimmel
2026-09-30 18:39 ` [PATCH net-next v5 05/14] ip6_tunnel: add drop reasons to the receive path Anton Danilov
2026-10-04 16:47   ` Ido Schimmel
2026-10-04 21:00   ` netdev-bot+sashiko [this message]
2026-09-30 18:39 ` [PATCH net-next v5 06/14] gre: make gre_parse_header() report a drop reason Anton Danilov
2026-09-30 18:39 ` [PATCH net-next v5 07/14] ip_gre: add drop reasons to the RX path Anton Danilov
2026-10-04 21:00   ` netdev-bot+sashiko
2026-09-30 18:39 ` [PATCH net-next v5 08/14] ip6_gre: " Anton Danilov
2026-09-30 18:39 ` [PATCH net-next v5 09/14] ip_tunnel: add drop reasons to the transmit path Anton Danilov
2026-10-04 16:08   ` Ido Schimmel
2026-10-04 16:15     ` Ido Schimmel
2026-09-30 18:39 ` [PATCH net-next v5 10/14] ip_gre: " Anton Danilov
2026-09-30 18:39 ` [PATCH net-next v5 11/14] ip6_gre: make prepare_ip6gre_xmit_other() void Anton Danilov
2026-09-30 18:39 ` [PATCH net-next v5 12/14] ip6_tunnel: make ip6_tnl_xmit() return a drop reason Anton Danilov
2026-10-04 21:00   ` netdev-bot+sashiko
2026-09-30 18:39 ` [PATCH net-next v5 13/14] ip6_gre: add drop reasons to the transmit path Anton Danilov
2026-10-04 21:00   ` netdev-bot+sashiko
2026-09-30 18:39 ` [PATCH net-next v5 14/14] vxlan: report a circular route as SKB_DROP_REASON_RECURSION_LIMIT Anton Danilov
2026-10-04 16:50 ` [PATCH net-next v5 00/14] tunnels: add core and gre drop reasons Ido Schimmel

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=179114764714.434549.10541167690659165045@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=littlesmilingcloud@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®