> The send hook vmci_transport_dgram_allow() refuses datagrams when the socket's
> netns is not in global mode (vsock_net_mode_global()), but the receive path
> (vmci_transport_recv_dgram_cb() -> vmci_transport_allow_dgram()) did not, so a
> socket bound in a non-global (local) netns received datagrams from peers it
> could never send to, defeating namespace isolation.
> 
> Add the check at the start of the receive decision, before the
> VMADDR_CID_HYPERVISOR short-circuit, so the hypervisor CID is covered too
> (matching the send side).
> 
> This was found by code inspection; I do not have VMCI hardware to test on
> (compile-tested only).
> 
> Fixes: eafb64f40ca4 ("vsock: add netns to vsock core")
> Signed-off-by: Bartłomiej Dmitruk <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=2


Reply via email to