net/iucv: take a reference on the socket found in afiucv_hs_rcv()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3881ac441f642d56503818123446f7298442236b · < c75a950e77356e526672cba4584080c6c8b793b6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/iucv: take a reference on the socket found in afiucv_hs_rcv()
afiucv_hs_rcv() looks up the destination socket under iucv_sk_list.lock, drops the lock, and then passes the socket to the afiucv_hs_callback_*() handlers without holding a reference. AF_IUCV sockets are not RCU-protected and are freed synchronously by iucv_sock_kill() -> sock_put(), so a concurrent close can free the socket in the window between read_unlock() and the handler, which then dereferences freed memory (for example sk->sk_data_ready() in afiucv_hs_callback_syn()).
Take a reference with sock_hold() while the socket is still on the list and release it with sock_put() once the handler has run.
From the CVE record · Linux
The Linux kernel's AF_IUCV receive path can use a socket after it has been freed if the socket is closed concurrently. This can cause a handler to dereference freed memory; the input does not specify attacker access, authentication requirements, or user interaction.
Engineers running Linux kernels with the affected net/iucv code should check their kernel; affected versions are not specified.