> __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 inspecting or storing new_mode when no bytes were
> transferred. This also prevents an empty write from locking the current
> mode.
>
> Fixes: eafb64f40ca4 ("vsock: add netns to vsock core")
> Cc: [email protected]
> Signed-off-by: Aldo Ariel Panzardo <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review ยท
https://sashiko.dev/#/patchset/[email protected]?part=1