rds: tcp: unregister sysctl before tearing down listen socket
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 6.12.101, 6.7, 6.18.42, 7.1.6
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: rds: tcp: unregister sysctl before tearing down listen socket rds_tcp_exit_net() frees the per-netns RDS TCP listen socket via rds_tcp_kill_sock() before unregistering the per-netns sysctl table. Since rds_tcp_skbuf_handler() derives the netns from rtn->rds_tcp_listen_sock->sk, a concurrent sysctl write can race with netns teardown and dereference the freed socket/sk. KASAN reports the race as: BUG: KASAN: slab-use-after-free in rds_tcp_skbuf_handler+0x2aa/0x2e0 rds_tcp_skbuf_handler net/rds/tcp.c:721 proc_sys_call_handler fs/proc/proc_sysctl.c vfs_write fs/read_write.c __x64_sys_pwrite64 fs/read_write.c Fix this by unregistering the RDS TCP sysctl table before calling rds_tcp_kill_sock(). unregister_net_sysctl_table() prevents new sysctl handlers from starting and waits for in-flight handlers to finish, so the listen socket can then be released safely. The fix was tested against the linked reproducer.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From de8d6de0ee27be4b2b1e5b06f04aeacbabbba492 · fixed in 80fffed08dc1c10e971066941d2daa56253f1552; From 7f5611cbc4871c7fb1ad36c2e5a9edad63dca95c · fixed in 16df2d154ec82e2f7e7585b4fa154751ba37729a; From 7f5611cbc4871c7fb1ad36c2e5a9edad63dca95c · fixed in 3aa13fe0c1bb7bc5312f878e61523e5d8cf3f85d; From 7f5611cbc4871c7fb1ad36c2e5a9edad63dca95c · fixed in 167e54c703ccd4fa028feb568b0d1002020cff86; From 6.12.10 · fixed in 6.12.101; From 6.6.160 · fixed in 6.7
- Linux Linux
6.13
- KernelLinux
fixed in 6.12.101; From 6.13.0 · fixed in 6.18.42; fixed in 7.1.6