summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2026-10-05 15:50:02 +0200
committerJakub Kicinski <kuba@kernel.org>2026-10-06 18:29:12 -0700
commit0984ebc631792acf8fff105112ee74a6b8f1efcc (patch)
tree9bbc7c1a2e55b2aec93c5bb6e722e9b8bc97688d /tools/perf/scripts/python/stackcollapse.py
parent538b529509c7ab0d909cb65bb7264edca1788d30 (diff)
downloadlinux-0984ebc631792acf8fff105112ee74a6b8f1efcc.tar.gz
linux-0984ebc631792acf8fff105112ee74a6b8f1efcc.zip
strparser: make sure __strp_recv isn't running before tearing down the parser
The comment above strp_done() claims that if strp is stopped, strp_recv will no longer be called. That's only true if the caller has a mechanism (eg locking) to guarantee that strp_recv() calls that started before strp_stop() have completed by the time we call strp_done(). This adds a dummy lock_sock/release_sock pair to guarantee that any in-flight strp_recv() (which runs under either bh_lock_sock or lock_sock, depending if it's called from ->sk_data_ready or strp_work) has completed. Only espintcp can be affected by this race condition, but this patch makes sure no future user of strp can have the bug. This could crash on strp->sk ("general mode" of strp), but this mode has been here for 9 years and has never been used. It'll be gone soon, no point worrying about it. Switch the stopped/paused/etc bits to u8's to avoid races between strp_stop() and strp_pause/unpause(). A reproducer has been published and turns the possible UAF into an exploit [1]. Reported-by: Hyunwoo Kim <imv4bel@gmail.com> Link: https://lore.kernel.org/all/aZLn2Faeg1FB7XOf@v4bel/ Link: https://lore.kernel.org/all/aZgpkyTDU3aXe_V0@v4bel/ Link: https://github.com/m0x41nos/RustyTux [1] Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)") Cc: stable@vger.kernel.org Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Hyunwoo Kim <imv4bel@gmail.com> Link: https://patch.msgid.link/425d9d926709b542ed5331110c19fee4aee1f28d.1791206940.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions