Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
Date: Sun, 18 Oct 2026 17:19:30 +0300	[thread overview]
Message-ID: <20261018141930.GA2559968@shredder> (raw)
In-Reply-To: <20261017104228.3418775-1-edumazet@kernel.org>

On Sat, Oct 17, 2026 at 12:42:28PM +0200, Eric Dumazet wrote:
> reg_vif_xmit() hands the skb to ip6mr_cache_report() as an
> MRT6MSG_WHOLEPKT report. skb_realloc_headroom() copies skb->cb[]
> into the report, which is queued to the mroute socket, where
> rawv6_recvmsg() reads it as IP6CB.
> 
> By the time the pim6reg device transmits the packet, skb->cb[] is
> not IP6CB anymore: qdisc_pkt_len_init() overwrites iif and ra,
> and any qdisc installed on the device (fq, fq_codel, pie, cake...)
> or a tc BPF program writing skb->cb[] fills the area holding
> dst0, srcrt, dst1, lastopt and flags.
> 
> Since commit dd433671fef3 ("ipv6: validate extension header length
> before copying to cmsg") these stale offsets can no longer cause
> out-of-bounds reads, but the mroute socket can still receive bogus
> IPV6_PKTINFO ifindex and extension header ancillary data.
> 
> Clear IP6CB before building the report. The skb is freed right
> after, so nothing else depends on its control block.
> 
> Fixes: 14fb64e1f449 ("[IPV6] MROUTE: Support PIM-SM (SSM).")
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

      parent reply	other threads:[~2026-10-18 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 10:42 [PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit() Eric Dumazet
2026-10-17 10:48 ` netdev-bot+sinfo
2026-10-18 14:19 ` Ido Schimmel [this message]

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=20261018141930.GA2559968@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --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