Files
Aldo Ariel Panzardo 2ec28c09b3 vsock: ignore empty child namespace mode writes
__vsock_net_mode_string() returns success without updating new_mode when
the transfer length is zero. Its caller then reads the uninitialized enum
and may permanently store a stack-derived value in the write-once child
mode.

Return before calling __vsock_net_mode_string() when *lenp is zero so
that the helper is never invoked with nothing to parse and new_mode is
never read uninitialized. This also prevents an empty write from
locking the current mode.

Fixes: eafb64f40c ("vsock: add netns to vsock core")
Cc: [email protected]
Reviewed-by: Luigi Leonardi <[email protected]>
Signed-off-by: Aldo Ariel Panzardo <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Reviewed-by: Bobby Eshleman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
2026-09-17 19:06:31 -07:00
..
…