From: sashiko-bot@kernel.org
To: "Todd Freed" <toddfreed@meta.com>
Cc: bpf@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v1 05/15] net: add METADATA_PSP dst to carry a psp association on an skb
Date: Thu, 12 Nov 2026 00:57:01 +0000 [thread overview]
Message-ID: <sashiko-outbox-210008@kernel.org> (raw)
In-Reply-To: <20261111005533.6436-6-toddfreed@meta.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] net: out-of-bounds read in skb_metadata_dst_cmp() [1]
--
commit bf04d738461897fa25a1f7c67c60f36977a2704d
Author: Todd Freed <toddfreed@meta.com>
net: add METADATA_PSP dst to carry a psp association on an skb
This commit adds a METADATA_PSP metadata_dst type to hold a reference to a
PSP association on socket-less skbs and validates target device and MTU
constraints during transmission.
> diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h
> index f45d1e3163f00..73755bce2df06 100644
> --- a/include/net/dst_metadata.h
> +++ b/include/net/dst_metadata.h
[ ... ]
> @@ -125,6 +142,8 @@ static inline int skb_metadata_dst_cmp(const struct sk_buff *skb_a,
> case METADATA_XFRM:
> return memcmp(&a->u.xfrm_info, &b->u.xfrm_info,
> sizeof(a->u.xfrm_info));
> + case METADATA_PSP:
> + return a->u.psp_info.pas != b->u.psp_info.pas;
> default:
> return 1;
> }
[Severity: Critical]
This problem wasn't introduced by this patch, but can skb_metadata_dst_cmp()
trigger an out-of-bounds read [1] by casting skb_dst() without checking
DST_METADATA?
include/net/dst_metadata.h:skb_metadata_dst_cmp() {
...
a = (const struct metadata_dst *) skb_dst(skb_a);
b = (const struct metadata_dst *) skb_dst(skb_b);
if (!a != !b || a->type != b->type)
return 1;
...
}
When loopback_xmit() preserves a standard rtable via skb_dst_force() and the
packet enters gro_list_prepare(), skb_metadata_dst_cmp() downcasts the rtable
to struct metadata_dst without using skb_metadata_dst(). Because struct
metadata_dst is larger than struct rtable, reading a->type and the union
members (such as METADATA_IP_TUNNEL's tun_info and options_len) reads past
the rtable slab object, which can crash the kernel if the access crosses an
unmapped page boundary.
[1] https://sashiko.dev/#/bug/linux-cad8ab9c-3c7e-48ba-8546-0bb9ceb5d8be
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261111005533.6436-1-toddfreed@meta.com?part=5
next prev parent reply other threads:[~2026-11-12 0:57 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 0:55 [PATCH net-next v1 00/15] psp: introduce socket-less associations Todd Freed
2026-11-11 0:55 ` [PATCH net-next v1 01/15] psp: get netns from net_device instead of sock Todd Freed
2026-11-12 0:56 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 02/15] psp: take the psp nexthdr from the packet on encap Todd Freed
2026-11-12 0:56 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 03/15] psp: declare psp_assoc_set_tx() in psp.h Todd Freed
2026-11-12 0:56 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 04/15] psp: add support for socket-less psp associations Todd Freed
2026-11-11 16:49 ` Daniel Zahka
2026-11-11 18:23 ` Todd Bert Freed
2026-11-11 19:01 ` Daniel Zahka
2026-11-11 21:49 ` Todd Bert Freed
2026-11-12 0:51 ` Todd Bert Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 05/15] net: add METADATA_PSP dst to carry a psp association on an skb Todd Freed
2026-11-12 0:57 ` sashiko-bot [this message]
2026-11-11 0:55 ` [PATCH net-next v1 06/15] net/sched: act_mirred: don't send decrypted skbs from egress to ingress Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 07/15] bpf: don't redirect " Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 08/15] psp: only give time-wait sockets of psp connections a validator Todd Freed
2026-11-11 11:37 ` Daniel Zahka
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 09/15] net/sched: add act_psp for psp transport mode Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 10/15] net/sched: flower: add psp_spi, psp_ver, and psp_dev matches Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 11/15] selftests: drv-net: psp: test socket-less associations and the tc psp action Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 12/15] selftests: drv-net: psp: test that software encap on ingress drops Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 13/15] selftests: tc-testing: run dependsOn probes outside the test namespace Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 14/15] selftests: tc-testing: add tests for the psp action Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 0:55 ` [PATCH net-next v1 15/15] Documentation: networking: psp: document socket-less associations Todd Freed
2026-11-12 0:57 ` sashiko-bot
2026-11-11 17:01 ` [PATCH net-next v1 00/15] psp: introduce " Daniel Zahka
2026-11-12 19:35 ` Todd Bert Freed
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=sashiko-outbox-210008@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=toddfreed@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.