milos-linux/include
Kyle Zeng 1ee90b77b7 net: guard timestamp cmsgs to real error queue skbs
skb_is_err_queue() treats PACKET_OUTGOING as the sole marker for an skb
from sk_error_queue. That assumption is not true for AF_PACKET sockets:
outgoing packet taps are also delivered to packet sockets with
skb->pkt_type == PACKET_OUTGOING, but their skb->cb is owned by AF_PACKET
instead of struct sock_exterr_skb.

If such an skb is received with timestamping enabled, the generic
timestamp cmsg path can read AF_PACKET control-buffer state as
sock_exterr_skb::opt_stats. With SO_RXQ_OVFL enabled, the packet drop
counter overlaps opt_stats. An odd drop count makes the path emit
SCM_TIMESTAMPING_OPT_STATS with skb->len and skb->data. For non-linear
skbs this copies past the linear head and can trigger hardened usercopy or
disclose adjacent heap contents.

Keep skb_is_err_queue() local to net/socket.c, but make it verify that
the PACKET_OUTGOING marker is paired with the sock_rmem_free destructor
installed by sock_queue_err_skb(). AF_PACKET receive skbs use normal
receive ownership and no longer pass as error-queue skbs, while legitimate
sk_error_queue entries keep the PACKET_OUTGOING marker and sock_rmem_free
ownership.

Fixes: 8605330aac ("tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260607021819.49698-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-09 18:32:08 -07:00
..
acpi ACPI: button: Enable wakeup GPEs for ACPI buttons at probe time 2026-05-25 09:52:34 +02:00
asm-generic ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
clocksource
crypto crypto/krb5, rxrpc: Fix lack of pre-decrypt/pre-verify length checks 2026-05-20 16:36:45 -07:00
cxl
drm Short summary of fixes pull: 2026-05-22 07:01:04 +10:00
dt-bindings
hyperv
keys
kunit kunit: fix use-after-free in debugfs when using kunit.filter 2026-05-21 10:45:49 -06:00
kvm
linux net/mlx5: Fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list 2026-06-08 18:56:18 -07:00
math-emu
media
memory
misc
net net: guard timestamp cmsgs to real error queue skbs 2026-06-09 18:32:08 -07:00
pcmcia
ras
rdma RDMA/core: Do not read wild stack memory in uverbs_get_handler_fn() 2026-05-19 19:32:48 -03:00
rv
scsi
soc
sound
target
trace Including fixes from Bluetooth, wireless and netfilter. 2026-05-21 14:39:12 -07:00
uapi soc: fixes for 7.1, part 2 2026-06-02 10:54:11 -07:00
ufs
vdso
video fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free 2026-05-04 10:35:55 +02:00
xen xen/arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in interface.h 2026-05-12 17:31:38 +02:00
Kbuild