Netdev List
 help / color / mirror / Atom feed
* [PATCH net v4 0/2] net/tls: fix UAF when TLS_RX is set on sockmap socket
@ 2026-05-11 15:52 Xingwang Xiang
  2026-05-11 15:52 ` [PATCH net v4 1/2] net/tls: reject TLS_RX setsockopt on psock-owned sockets Xingwang Xiang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xingwang Xiang @ 2026-05-11 15:52 UTC (permalink / raw)
  To: john.fastabend
  Cc: kuba, jakub, sd, davem, pabeni, horms, netdev, mrpre,
	Xingwang Xiang

This series fixes a use-after-free triggered by configuring TLS RX on a
socket that is already inserted into a sockmap (the reverse of the order
that is already guarded against by tcp_bpf_check_ulp).

Patch 1 adds the symmetric check to do_tls_setsockopt_conf: if a psock
is already attached when TLS_RX is requested, return -EBUSY before any
strparser state is touched.

Patch 2 adds a regression test to the KTLS selftest suite that drives
the vulnerable setup and verifies the kernel either rejects the
combination or handles it correctly end-to-end.

Xingwang Xiang (2):
  net/tls: reject TLS_RX setsockopt on psock-owned sockets
  selftests: bpf: add test for KTLS+sockmap reverse-order UAF

 net/tls/tls_main.c                            |   9 ++
 .../selftests/bpf/prog_tests/sockmap_ktls.c   | 109 ++++++++++++++++++
 .../selftests/bpf/progs/test_sockmap_ktls.c   |  21 ++++
 3 files changed, 139 insertions(+)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-12  2:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 15:52 [PATCH net v4 0/2] net/tls: fix UAF when TLS_RX is set on sockmap socket Xingwang Xiang
2026-05-11 15:52 ` [PATCH net v4 1/2] net/tls: reject TLS_RX setsockopt on psock-owned sockets Xingwang Xiang
2026-05-11 15:52 ` [PATCH net v4 2/2] selftests: bpf: add test for KTLS+sockmap reverse-order UAF Xingwang Xiang
2026-05-11 23:13 ` [PATCH net v4 0/2] net/tls: fix UAF when TLS_RX is set on sockmap socket Jakub Kicinski
     [not found]   ` <CAFFJMPzw8pcwX9g7iv3F=FpHQyovUgZZ28P7XfH3gmiay-JfpA@mail.gmail.com>
2026-05-12  0:10     ` xw x
2026-05-12  2:06       ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox