Commit 381ee88
vsock: Do not allow binding to VMADDR_PORT_ANY
It is possible for a vsock to autobind to VMADDR_PORT_ANY. This can
cause a use-after-free when a connection is made to the bound socket.
The socket returned by accept() also has port VMADDR_PORT_ANY but is not
on the list of unbound sockets. Binding it will result in an extra
refcount decrement similar to the one fixed in fcdd224 (vsock: Keep
the binding until socket destruction).
Modify the check in __vsock_bind_connectible() to also prevent binding
to VMADDR_PORT_ANY.
Fixes: d021c34 ("VSOCK: Introduce VM Sockets")
Reported-by: Budimir Markovic<[email protected]>
Signed-off-by: Budimir Markovic<[email protected]>
Reviewed-by: Stefano Garzarella<[email protected]>
Link:https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski<[email protected]>
CVE-2025-38618
(cherry picked from commit aba0c94f61ec05315fa7815d21aefa4c87f6a9f4)
Signed-off-by: Ian Whitfield<[email protected]>
Acked-by: Bethany Jamison <[email protected]>
Acked-by: Stefan Bader <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>1 parent 8438f04 commit 381ee88
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
| 658 | + | |
| 659 | + | |
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
| |||
0 commit comments