kcm: Serialise kcm_sendmsg() for the same socket.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ab7ac4eb9832e32a09f4e8042705484d2fb0aad3 · < 00425508f30baa5ab6449a1f478480ca7cffa6da| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
kcm: Serialise kcm_sendmsg() for the same socket.
syzkaller reported UAF in kcm_release(). [0]
The scenario is
1. Thread A builds a skb with MSG_MORE and sets kcm->seq_skb.
2. Thread A resumes building skb from kcm->seq_skb but is blocked by sk_stream_wait_memory()
3. Thread B calls sendmsg() concurrently, finishes building kcm->seq_skb and puts the skb to the write queue
4. Thread A faces an error and finally frees skb that is already in the write queue
From the CVE record · Linux
The Linux kernel’s KCM socket code can use freed memory when concurrent sendmsg() calls operate on the same socket. A local process with access to a KCM socket can trigger the flaw when one thread builds a message with MSG_MORE while another sends on that socket; socket release can then double-free the queued buffer.
Engineers running Linux kernels with KCM support should check their kernel vendor’s guidance; affected versions were not specified.