aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorChengfeng Ye <nicoyip.dev@gmail.com>2026-09-27 15:51:20 +0800
committerJakub Kicinski <kuba@kernel.org>2026-09-30 17:42:55 -0700
commit1bc449382b3d5f5a2403c4aea244073c9ed72a7c (patch)
treea97c1a9f6c4f5f0b80235628a4c3d3af06f748f6 /scripts/Makefile.thinlto
parents390/ism: Zerorize dmb at allocation (diff)
net/smc: Hold a socket reference for transmit work
SMC transmit work is queued without holding a socket reference. After an active close has cancelled tx_work, a received CDC message can queue it again while the socket is in SMC_PEERCLOSEWAIT1. Passive close can then reach SMC_CLOSED, call smc_conn_free() and drop the last socket reference before smc_tx_work() acquires the socket lock. The worker then accesses the freed socket. KASAN reported: BUG: KASAN: slab-use-after-free in lock_sock_nested+0x97/0x180 Write of size 8 by task kworker/0:1/11 Workqueue: smc_tx_wq-00000000 smc_tx_work Call Trace: lock_sock_nested+0x97/0x180 smc_tx_work+0x5d/0x170 process_one_work+0x5ce/0xeb0 worker_thread+0x45b/0xd10 Allocated by task 24: sk_prot_alloc+0x56/0x210 sk_alloc+0x2b/0x6f0 smc_tcp_listen_work+0x16d/0xfc0 Freed by task 182: slab_free_after_rcu_debug+0xa6/0x1e0 rcu_core+0x509/0x1850 Hold a socket reference for each successful enqueue and release it when the worker finishes or a pending invocation is cancelled. Cover all three queue sites and all cancellation sites, including the socket options. Check conn->freed in smc_tx_pending() under the socket lock: retaining the socket does not retain connection resources released by smc_conn_free(). This also covers pending transmit processing from smc_release_cb(). Use queue_delayed_work() for the busy-slot retry as well. All tx_work delays are zero, so an already queued invocation needs no timer update. Unlike mod_delayed_work(), its return value distinguishes a successful enqueue from work disabled temporarily by cancel_delayed_work_sync(), allowing the extra reference to be returned when no work was queued. Cc: stable+noautosel@kernel.org # LLM report + LLM fix, not seen in real life Fixes: e6727f39004b ("smc: send data (through RDMA)") Link: https://lists.openwall.net/netdev/2026/09/09/105 Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com> Link: https://patch.msgid.link/20260927075120.3695060-1-nicoyip.dev@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions