diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2026-08-28 16:09:04 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-28 16:09:04 -0700 |
| commit | b84cc38f3f0da7bd2e02f5165b653379c5eb8902 (patch) | |
| tree | e4ab422b354db5032a759be2e6bf14b68e726d29 /tools/perf/scripts/python/bin | |
| parent | 7e1d6caa9c6bd8e89a0639ae44be8b23f43386fc (diff) | |
| parent | 385e474086c2e7e29e2dded690be40dc273e20ee (diff) | |
Merge branch 'tcp-fix-use-after-free-in-do_tcp_getsockopt'
Cen Zhang says:
====================
tcp: fix use-after-free in do_tcp_getsockopt()
do_tcp_getsockopt() has two lockless reads of icsk_ca_ops. Since BPF
struct_ops congestion control made icsk_ca_ops point to dynamically
allocated memory, a concurrent setsockopt(TCP_CONGESTION) can replace
the pointer and free the old object while either reader is using it.
Patch 1 fixes the TCP_CONGESTION path by copying ca_ops->name to a
stack buffer while holding rcu_read_lock(). It also uses READ_ONCE()
for the lockless load and annotates the relevant icsk_ca_ops stores
with WRITE_ONCE().
Patch 2 fixes the TCP_CC_INFO path by keeping the READ_ONCE() load,
ca_ops->get_info lookup, and call inside an RCU read-side critical
section.
====================
Link: https://patch.msgid.link/cover.1787870710.git.blbllhy@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
