net/smc: fix use-after-free in smc_rx_pipe_buf_release()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9014db202cb764b8e14c53e7bacc81f9a1a2ba7f · < c924884743e948e25625b7fbf3ee2a9325a204a7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/smc: fix use-after-free in smc_rx_pipe_buf_release()
smc_rx_splice() hands RMB pages to a pipe and takes a socket reference per entry so the smc_sock stays alive until the reader finishes. The connection does not: a concurrent close runs smc_conn_free(), which releases the receive buffer back to the link group pool.
smc_rx_pipe_buf_release() tests sk_state before taking the socket lock. The state can change between the test and the lock, and smc_rx_update_cons() then dereferences conn->rmb_desc and walks conn->lgr, which smc_conn_free() has already released. On the is_reg_err path smcr_buf_unuse() frees the descriptor outright, so this is a use-after-free.
Take the socket lock first and test conn->freed instead. smc_conn_free() sets that flag before releasing anything, and every caller holds the socket lock. The two paths exclude each other: either the pipe release runs first with everything valid, or it sees the flag and skips the update.
From the CVE record · Linux
The Linux kernel’s SMC pipe buffer release path can use a receive-buffer descriptor after a concurrent connection close frees it. This can occur when a pipe reader releases a buffer while the connection is closing. The input does not specify whether exploitation requires local or network access, authentication, or other user interaction.
Engineers running Linux kernels with the affected net/smc code should check their kernel versions; affected versions are not specified.