Thread View: linux.kernel.netdev
4 messages
4 total messages
Started by Eric Dumazet
Sat, 17 Oct 2026 10:42
[PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
Author: Eric Dumazet
Date: Sat, 17 Oct 2026 10:42
Date: Sat, 17 Oct 2026 10:42
45 lines
6935 bytes
6935 bytes
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>
---
net/ipv6/ip6mr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 36f117ad367081444a96b5486add69bd7dcaff1f..3a551be30f153ae37c49bfa3c4777ae66f729a43 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -653,6 +653,12 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
DEV_STATS_ADD(dev, tx_bytes, skb->len);
DEV_STATS_INC(dev, tx_packets);
+ /* skb->cb[] holds qdisc/tc state at this point, not IP6CB.
+ * ip6mr_cache_report() copies it to the report delivered to
+ * the mroute socket, where it is read as IP6CB.
+ */
+ memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
+
ip6mr_cache_report(mrt, skb, READ_ONCE(mrt->mroute_reg_vif_num),
MRT6MSG_WHOLEPKT);
rcu_read_unlock();
--
2.53.0
Re: [PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
Author: netdev-bot+sinfo
Date: Sat, 17 Oct 2026 10:48
Date: Sat, 17 Oct 2026 10:48
22 lines
6337 bytes
6337 bytes
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then. The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Re: [PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
Author: patchwork-bot+netdevbpf
Date: Tue, 20 Oct 2026 21:10
Date: Tue, 20 Oct 2026 21:10
28 lines
8777 bytes
8777 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 17 Oct 2026 12:42:28 +0200 you 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.
>
> [...]
Here is the summary with links:
- [net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
https://git.kernel.org/netdev/net-next/c/238164201431
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net-next] ip6mr: clear skb->cb[] in reg_vif_xmit()
Author: Eric Dumazet
Date: Wed, 21 Oct 2026 07:17
Date: Wed, 21 Oct 2026 07:17
39 lines
10139 bytes
10139 bytes
Le mar. 20 oct. 2026 ร 23:10, <patchwork-bot+netdevbpf@kernel.org> a รฉcrit : > > Hello: > > This patch was applied to netdev/net-next.git (main) > by Jakub Kicinski <kuba@kernel.org>: > > On Sat, 17 Oct 2026 12:42:28 +0200 you 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. > > > > [...] > > Here is the summary with links: > - [net-next] ip6mr: clear skb->cb[] in reg_vif_xmit() > https://git.kernel.org/netdev/net-next/c/238164201431 > > You are awesome, thank you! > -- > Deet-doot-dot, I am a bot. > https://korg.docs.kernel.org/patchwork/pwbot.html For some reason 'Reviewed-by: Ido Schimmel <idosch@nvidia.com>' has been lost. https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=238164201431a425e48dfcb8e9a59de63caf175b Thanks.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads