Files
linux/include/net
Kyle Zeng c78b477049 net: require a full socket in sock_confirm_neigh()
An skb can retain dst_pending_confirm after its original output and
socket owner have changed. For example, a raw MSG_CONFIRM packet can
cross veth, have a TCP request socket assigned by TPROXY, and be bridged
into gretap. Neighbor output for the outer packet then calls
sock_confirm_neigh() with the request socket in skb->sk.

The helper unconditionally treats a non-NULL skb->sk as a full socket
when accessing sk_dst_pending_confirm. TCP request and TIME_WAIT sockets
do not contain that field. This produces an out-of-bounds four-byte read
and, if the word is nonzero, an out-of-bounds four-byte zero write. A
KASAN-enabled kernel reports:

  BUG: KASAN: slab-out-of-bounds in ip_finish_output2+0xc9f/0xd60
  Read of size 4 at addr ffff8880bdc3d880 by task tproxy_dst_conf/1771

Require sk_fullsock() before accessing the socket field, moving the
existing helper earlier in the header to make it available here. Keep
neigh_confirm() independent of the socket type so the skb's neighbor
confirmation still works, including for socketless packets. This also
covers the IPv6, VRF, and BPF neighbor-output callers.

Fixes: 4ff0620354 ("net: add dst_pending_confirm flag to skbuff")
Signed-off-by: Kyle Zeng <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
2026-11-09 18:01:09 -08:00
..
2026-10-29 06:05:56 +00:00
2026-09-07 16:38:37 -07:00
…
…
…
…
…
…
…
…
2024-08-26 09:37:23 -07:00
…
2024-11-13 18:49:50 -08:00
2024-08-26 09:37:23 -07:00
…
…
2025-08-26 17:34:31 -07:00
…
…
…
2026-11-09 17:00:32 -08:00
…
2026-09-18 16:44:08 -07:00
2024-08-26 09:37:23 -07:00
…
2026-08-13 12:30:27 +02:00
…
2024-12-06 17:43:08 -08:00
…
…
…
…
…
…
…
2025-09-18 12:32:06 +02:00
…
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
…
…
2025-04-11 18:58:10 -07:00
…
…
…
2025-09-08 18:06:21 -07:00
…
2025-07-11 11:00:57 -07:00
…
2026-03-13 18:57:44 -07:00
…