Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-05-05 Thread Arseniy Krasnov
> But now that it's explained, the bugfix as proposed is incomplete: > userspace can set features twice and the second time will leak > old VIRTIO_VSOCK_F_SEQPACKET bit value. > > And I am pretty sure the Fixes tag is wrong. > > So I wrote this, but I actually don't have a set for > seqpacket to

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 22, 2024 at 09:00:31AM -0400, Stefan Hajnoczi wrote: > On Sun, Apr 21, 2024 at 12:06:06PM +0900, Jeongjun Park wrote: > > static bool vhost_transport_seqpacket_allow(u32 remote_cid) > > { > > > > vsock = vhost_vsock_get(remote_cid); > > > > if (vsock) > >

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-22 Thread Stefan Hajnoczi
On Sun, Apr 21, 2024 at 12:06:06PM +0900, Jeongjun Park wrote: > static bool vhost_transport_seqpacket_allow(u32 remote_cid) > { > > vsock = vhost_vsock_get(remote_cid); > > if (vsock) > seqpacket_allow = vsock->seqpacket_allow; > > } > > I think this is due

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-20 Thread Jeongjun Park
static bool vhost_transport_seqpacket_allow(u32 remote_cid) { vsock = vhost_vsock_get(remote_cid); if (vsock) seqpacket_allow = vsock->seqpacket_allow; } I think this is due to reading a previously created uninitialized vsock->seqpacket_allow inside

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-20 Thread Michael S. Tsirkin
On Sat, Apr 20, 2024 at 05:57:50PM +0900, Jeongjun Park wrote: > Change vhost_vsock_dev_open() to use kvzalloc() instead of kvmalloc() > to avoid uninit state. > > Reported-by: syzbot+6c21aeb59d0e82eb2...@syzkaller.appspotmail.com > Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by >