virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio_ring: fix KMSAN error for premapped mode
@ 2024-06-06 11:13 Xuan Zhuo
  2024-06-06 11:54 ` Ilya Leoshkevich
  2024-06-07  6:34 ` Jason Wang
  0 siblings, 2 replies; 11+ messages in thread
From: Xuan Zhuo @ 2024-06-06 11:13 UTC (permalink / raw)
  To: virtualization
  Cc: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez,
	Alexander Potapenko, Ilya Leoshkevich

Add kmsan for virtqueue_dma_map_single_attrs to fix:

BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
 receive_buf+0x45ca/0x6990
 virtnet_poll+0x17e0/0x3130
 net_rx_action+0x832/0x26e0
 handle_softirqs+0x330/0x10f0
 [...]

Uninit was created at:
 __alloc_pages_noprof+0x62a/0xe60
 alloc_pages_noprof+0x392/0x830
 skb_page_frag_refill+0x21a/0x5c0
 virtnet_rq_alloc+0x50/0x1500
 try_fill_recv+0x372/0x54c0
 virtnet_open+0x210/0xbe0
 __dev_open+0x56e/0x920
 __dev_change_flags+0x39c/0x2000
 dev_change_flags+0xaa/0x200
 do_setlink+0x197a/0x7420
 rtnl_setlink+0x77c/0x860
 [...]

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Tested-by: Alexander Potapenko <glider@google.com>
---
 drivers/virtio/virtio_ring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 6f7e5010a673..80669e05bf0e 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -3126,8 +3126,10 @@ dma_addr_t virtqueue_dma_map_single_attrs(struct virtqueue *_vq, void *ptr,
 {
 	struct vring_virtqueue *vq = to_vvq(_vq);
 
-	if (!vq->use_dma_api)
+	if (!vq->use_dma_api) {
+		kmsan_handle_dma(virt_to_page(ptr), offset_in_page(ptr), size, dir);
 		return (dma_addr_t)virt_to_phys(ptr);
+	}
 
 	return dma_map_single_attrs(vring_dma_dev(vq), ptr, size, dir, attrs);
 }
-- 
2.32.0.3.g01195cf9f


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-06-06 11:13 [PATCH] virtio_ring: fix KMSAN error for premapped mode Xuan Zhuo
@ 2024-06-06 11:54 ` Ilya Leoshkevich
  2024-06-07  6:34 ` Jason Wang
  1 sibling, 0 replies; 11+ messages in thread
From: Ilya Leoshkevich @ 2024-06-06 11:54 UTC (permalink / raw)
  To: Xuan Zhuo, virtualization
  Cc: Michael S. Tsirkin, Jason Wang, Eugenio Pérez,
	Alexander Potapenko

On Thu, 2024-06-06 at 19:13 +0800, Xuan Zhuo wrote:
> Add kmsan for virtqueue_dma_map_single_attrs to fix:
> 
> BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
>  receive_buf+0x45ca/0x6990
>  virtnet_poll+0x17e0/0x3130
>  net_rx_action+0x832/0x26e0
>  handle_softirqs+0x330/0x10f0
>  [...]
> 
> Uninit was created at:
>  __alloc_pages_noprof+0x62a/0xe60
>  alloc_pages_noprof+0x392/0x830
>  skb_page_frag_refill+0x21a/0x5c0
>  virtnet_rq_alloc+0x50/0x1500
>  try_fill_recv+0x372/0x54c0
>  virtnet_open+0x210/0xbe0
>  __dev_open+0x56e/0x920
>  __dev_change_flags+0x39c/0x2000
>  dev_change_flags+0xaa/0x200
>  do_setlink+0x197a/0x7420
>  rtnl_setlink+0x77c/0x860
>  [...]
> 
> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Tested-by: Alexander Potapenko <glider@google.com>
> ---
>  drivers/virtio/virtio_ring.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>  # s390x

Thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-06-06 11:13 [PATCH] virtio_ring: fix KMSAN error for premapped mode Xuan Zhuo
  2024-06-06 11:54 ` Ilya Leoshkevich
@ 2024-06-07  6:34 ` Jason Wang
  2024-06-24 13:51   ` Alexander Potapenko
  1 sibling, 1 reply; 11+ messages in thread
From: Jason Wang @ 2024-06-07  6:34 UTC (permalink / raw)
  To: Xuan Zhuo
  Cc: virtualization, Michael S. Tsirkin, Eugenio Pérez,
	Alexander Potapenko, Ilya Leoshkevich

On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>
> Add kmsan for virtqueue_dma_map_single_attrs to fix:
>
> BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
>  receive_buf+0x45ca/0x6990
>  virtnet_poll+0x17e0/0x3130
>  net_rx_action+0x832/0x26e0
>  handle_softirqs+0x330/0x10f0
>  [...]
>
> Uninit was created at:
>  __alloc_pages_noprof+0x62a/0xe60
>  alloc_pages_noprof+0x392/0x830
>  skb_page_frag_refill+0x21a/0x5c0
>  virtnet_rq_alloc+0x50/0x1500
>  try_fill_recv+0x372/0x54c0
>  virtnet_open+0x210/0xbe0
>  __dev_open+0x56e/0x920
>  __dev_change_flags+0x39c/0x2000
>  dev_change_flags+0xaa/0x200
>  do_setlink+0x197a/0x7420
>  rtnl_setlink+0x77c/0x860
>  [...]
>
> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Tested-by: Alexander Potapenko <glider@google.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-06-07  6:34 ` Jason Wang
@ 2024-06-24 13:51   ` Alexander Potapenko
  2024-06-24 13:57     ` Michael S. Tsirkin
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Potapenko @ 2024-06-24 13:51 UTC (permalink / raw)
  To: Jason Wang
  Cc: Xuan Zhuo, virtualization, Michael S. Tsirkin, Eugenio Pérez,
	Ilya Leoshkevich, Aleksandr Nogikh

On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com> wrote:
>
> On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> >
> > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> >
> > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> >  receive_buf+0x45ca/0x6990
> >  virtnet_poll+0x17e0/0x3130
> >  net_rx_action+0x832/0x26e0
> >  handle_softirqs+0x330/0x10f0
> >  [...]
> >
> > Uninit was created at:
> >  __alloc_pages_noprof+0x62a/0xe60
> >  alloc_pages_noprof+0x392/0x830
> >  skb_page_frag_refill+0x21a/0x5c0
> >  virtnet_rq_alloc+0x50/0x1500
> >  try_fill_recv+0x372/0x54c0
> >  virtnet_open+0x210/0xbe0
> >  __dev_open+0x56e/0x920
> >  __dev_change_flags+0x39c/0x2000
> >  dev_change_flags+0xaa/0x200
> >  do_setlink+0x197a/0x7420
> >  rtnl_setlink+0x77c/0x860
> >  [...]
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > Tested-by: Alexander Potapenko <glider@google.com>
>
> Acked-by: Jason Wang <jasowang@redhat.com>

Jason, Michael, any chance this patch can make it to 6.10?
The bug in question has essentially been blocking KMSAN on syzbot for
the past month:
https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa

The patch should probably have
  Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for virtqueue")

, but I am not exactly sure why syzkaller only started triggering the
bug this year, given that the patch dates back to 2023.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-06-24 13:51   ` Alexander Potapenko
@ 2024-06-24 13:57     ` Michael S. Tsirkin
  2024-07-15 13:24       ` Alexander Potapenko
  0 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2024-06-24 13:57 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: Jason Wang, Xuan Zhuo, virtualization, Eugenio Pérez,
	Ilya Leoshkevich, Aleksandr Nogikh

On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko wrote:
> On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com> wrote:
> >
> > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > >
> > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > >
> > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > >  receive_buf+0x45ca/0x6990
> > >  virtnet_poll+0x17e0/0x3130
> > >  net_rx_action+0x832/0x26e0
> > >  handle_softirqs+0x330/0x10f0
> > >  [...]
> > >
> > > Uninit was created at:
> > >  __alloc_pages_noprof+0x62a/0xe60
> > >  alloc_pages_noprof+0x392/0x830
> > >  skb_page_frag_refill+0x21a/0x5c0
> > >  virtnet_rq_alloc+0x50/0x1500
> > >  try_fill_recv+0x372/0x54c0
> > >  virtnet_open+0x210/0xbe0
> > >  __dev_open+0x56e/0x920
> > >  __dev_change_flags+0x39c/0x2000
> > >  dev_change_flags+0xaa/0x200
> > >  do_setlink+0x197a/0x7420
> > >  rtnl_setlink+0x77c/0x860
> > >  [...]
> > >
> > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > Tested-by: Alexander Potapenko <glider@google.com>
> >
> > Acked-by: Jason Wang <jasowang@redhat.com>
> 
> Jason, Michael, any chance this patch can make it to 6.10?
> The bug in question has essentially been blocking KMSAN on syzbot for
> the past month:
> https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> 
> The patch should probably have
>   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for virtqueue")
> 
> , but I am not exactly sure why syzkaller only started triggering the
> bug this year, given that the patch dates back to 2023.

Yes that's probably a good idea. I will queue it with this tag.

-- 
MST


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-06-24 13:57     ` Michael S. Tsirkin
@ 2024-07-15 13:24       ` Alexander Potapenko
  2024-07-15 14:20         ` Michael S. Tsirkin
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Potapenko @ 2024-07-15 13:24 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Jason Wang, Xuan Zhuo, virtualization, Eugenio Pérez,
	Ilya Leoshkevich, Aleksandr Nogikh

On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko wrote:
> > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com> wrote:
> > >
> > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > >
> > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > >
> > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > >  receive_buf+0x45ca/0x6990
> > > >  virtnet_poll+0x17e0/0x3130
> > > >  net_rx_action+0x832/0x26e0
> > > >  handle_softirqs+0x330/0x10f0
> > > >  [...]
> > > >
> > > > Uninit was created at:
> > > >  __alloc_pages_noprof+0x62a/0xe60
> > > >  alloc_pages_noprof+0x392/0x830
> > > >  skb_page_frag_refill+0x21a/0x5c0
> > > >  virtnet_rq_alloc+0x50/0x1500
> > > >  try_fill_recv+0x372/0x54c0
> > > >  virtnet_open+0x210/0xbe0
> > > >  __dev_open+0x56e/0x920
> > > >  __dev_change_flags+0x39c/0x2000
> > > >  dev_change_flags+0xaa/0x200
> > > >  do_setlink+0x197a/0x7420
> > > >  rtnl_setlink+0x77c/0x860
> > > >  [...]
> > > >
> > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > Tested-by: Alexander Potapenko <glider@google.com>
> > >
> > > Acked-by: Jason Wang <jasowang@redhat.com>
> >
> > Jason, Michael, any chance this patch can make it to 6.10?
> > The bug in question has essentially been blocking KMSAN on syzbot for
> > the past month:
> > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> >
> > The patch should probably have
> >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for virtqueue")
> >
> > , but I am not exactly sure why syzkaller only started triggering the
> > bug this year, given that the patch dates back to 2023.
>
> Yes that's probably a good idea. I will queue it with this tag.

Hi Michael,

Looks like the patch is still stuck in the limbo :(

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-07-15 13:24       ` Alexander Potapenko
@ 2024-07-15 14:20         ` Michael S. Tsirkin
  2024-07-15 15:30           ` Ilya Leoshkevich
  0 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2024-07-15 14:20 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: Jason Wang, Xuan Zhuo, virtualization, Eugenio Pérez,
	Ilya Leoshkevich, Aleksandr Nogikh

On Mon, Jul 15, 2024 at 03:24:17PM +0200, Alexander Potapenko wrote:
> On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko wrote:
> > > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com> wrote:
> > > >
> > > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > > >
> > > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > > >
> > > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > > >  receive_buf+0x45ca/0x6990
> > > > >  virtnet_poll+0x17e0/0x3130
> > > > >  net_rx_action+0x832/0x26e0
> > > > >  handle_softirqs+0x330/0x10f0
> > > > >  [...]
> > > > >
> > > > > Uninit was created at:
> > > > >  __alloc_pages_noprof+0x62a/0xe60
> > > > >  alloc_pages_noprof+0x392/0x830
> > > > >  skb_page_frag_refill+0x21a/0x5c0
> > > > >  virtnet_rq_alloc+0x50/0x1500
> > > > >  try_fill_recv+0x372/0x54c0
> > > > >  virtnet_open+0x210/0xbe0
> > > > >  __dev_open+0x56e/0x920
> > > > >  __dev_change_flags+0x39c/0x2000
> > > > >  dev_change_flags+0xaa/0x200
> > > > >  do_setlink+0x197a/0x7420
> > > > >  rtnl_setlink+0x77c/0x860
> > > > >  [...]
> > > > >
> > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > > Tested-by: Alexander Potapenko <glider@google.com>
> > > >
> > > > Acked-by: Jason Wang <jasowang@redhat.com>
> > >
> > > Jason, Michael, any chance this patch can make it to 6.10?
> > > The bug in question has essentially been blocking KMSAN on syzbot for
> > > the past month:
> > > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> > >
> > > The patch should probably have
> > >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for virtqueue")
> > >
> > > , but I am not exactly sure why syzkaller only started triggering the
> > > bug this year, given that the patch dates back to 2023.
> >
> > Yes that's probably a good idea. I will queue it with this tag.
> 
> Hi Michael,
> 
> Looks like the patch is still stuck in the limbo :(

It should be in linux next. Don't you see it there?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-07-15 14:20         ` Michael S. Tsirkin
@ 2024-07-15 15:30           ` Ilya Leoshkevich
  2024-07-15 16:06             ` Michael S. Tsirkin
  0 siblings, 1 reply; 11+ messages in thread
From: Ilya Leoshkevich @ 2024-07-15 15:30 UTC (permalink / raw)
  To: Michael S. Tsirkin, Alexander Potapenko
  Cc: Jason Wang, Xuan Zhuo, virtualization, Eugenio Pérez,
	Aleksandr Nogikh

On Mon, 2024-07-15 at 10:20 -0400, Michael S. Tsirkin wrote:
> On Mon, Jul 15, 2024 at 03:24:17PM +0200, Alexander Potapenko wrote:
> > On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com>
> > wrote:
> > > 
> > > On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko
> > > wrote:
> > > > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com>
> > > > wrote:
> > > > > 
> > > > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo
> > > > > <xuanzhuo@linux.alibaba.com> wrote:
> > > > > > 
> > > > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > > > > 
> > > > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > > > >  receive_buf+0x45ca/0x6990
> > > > > >  virtnet_poll+0x17e0/0x3130
> > > > > >  net_rx_action+0x832/0x26e0
> > > > > >  handle_softirqs+0x330/0x10f0
> > > > > >  [...]
> > > > > > 
> > > > > > Uninit was created at:
> > > > > >  __alloc_pages_noprof+0x62a/0xe60
> > > > > >  alloc_pages_noprof+0x392/0x830
> > > > > >  skb_page_frag_refill+0x21a/0x5c0
> > > > > >  virtnet_rq_alloc+0x50/0x1500
> > > > > >  try_fill_recv+0x372/0x54c0
> > > > > >  virtnet_open+0x210/0xbe0
> > > > > >  __dev_open+0x56e/0x920
> > > > > >  __dev_change_flags+0x39c/0x2000
> > > > > >  dev_change_flags+0xaa/0x200
> > > > > >  do_setlink+0x197a/0x7420
> > > > > >  rtnl_setlink+0x77c/0x860
> > > > > >  [...]
> > > > > > 
> > > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > > > Tested-by: Alexander Potapenko <glider@google.com>
> > > > > 
> > > > > Acked-by: Jason Wang <jasowang@redhat.com>
> > > > 
> > > > Jason, Michael, any chance this patch can make it to 6.10?
> > > > The bug in question has essentially been blocking KMSAN on
> > > > syzbot for
> > > > the past month:
> > > > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> > > > 
> > > > The patch should probably have
> > > >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for
> > > > virtqueue")
> > > > 
> > > > , but I am not exactly sure why syzkaller only started
> > > > triggering the
> > > > bug this year, given that the patch dates back to 2023.
> > > 
> > > Yes that's probably a good idea. I will queue it with this tag.
> > 
> > Hi Michael,
> > 
> > Looks like the patch is still stuck in the limbo :(
> 
> It should be in linux next. Don't you see it there?

FWIW I ran linux-next with KMSAN today and this fix was already there.

But in the meantime another similarly looking issue crept in:

https://lore.kernel.org/netdev/20240712195759.GA2972562@myrica/T/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-07-15 15:30           ` Ilya Leoshkevich
@ 2024-07-15 16:06             ` Michael S. Tsirkin
  2024-07-15 16:32               ` Alexander Potapenko
  0 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2024-07-15 16:06 UTC (permalink / raw)
  To: Ilya Leoshkevich
  Cc: Alexander Potapenko, Jason Wang, Xuan Zhuo, virtualization,
	Eugenio Pérez, Aleksandr Nogikh

On Mon, Jul 15, 2024 at 05:30:49PM +0200, Ilya Leoshkevich wrote:
> On Mon, 2024-07-15 at 10:20 -0400, Michael S. Tsirkin wrote:
> > On Mon, Jul 15, 2024 at 03:24:17PM +0200, Alexander Potapenko wrote:
> > > On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com>
> > > wrote:
> > > > 
> > > > On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko
> > > > wrote:
> > > > > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com>
> > > > > wrote:
> > > > > > 
> > > > > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo
> > > > > > <xuanzhuo@linux.alibaba.com> wrote:
> > > > > > > 
> > > > > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > > > > > 
> > > > > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > > > > >  receive_buf+0x45ca/0x6990
> > > > > > >  virtnet_poll+0x17e0/0x3130
> > > > > > >  net_rx_action+0x832/0x26e0
> > > > > > >  handle_softirqs+0x330/0x10f0
> > > > > > >  [...]
> > > > > > > 
> > > > > > > Uninit was created at:
> > > > > > >  __alloc_pages_noprof+0x62a/0xe60
> > > > > > >  alloc_pages_noprof+0x392/0x830
> > > > > > >  skb_page_frag_refill+0x21a/0x5c0
> > > > > > >  virtnet_rq_alloc+0x50/0x1500
> > > > > > >  try_fill_recv+0x372/0x54c0
> > > > > > >  virtnet_open+0x210/0xbe0
> > > > > > >  __dev_open+0x56e/0x920
> > > > > > >  __dev_change_flags+0x39c/0x2000
> > > > > > >  dev_change_flags+0xaa/0x200
> > > > > > >  do_setlink+0x197a/0x7420
> > > > > > >  rtnl_setlink+0x77c/0x860
> > > > > > >  [...]
> > > > > > > 
> > > > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > > > > Tested-by: Alexander Potapenko <glider@google.com>
> > > > > > 
> > > > > > Acked-by: Jason Wang <jasowang@redhat.com>
> > > > > 
> > > > > Jason, Michael, any chance this patch can make it to 6.10?
> > > > > The bug in question has essentially been blocking KMSAN on
> > > > > syzbot for
> > > > > the past month:
> > > > > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> > > > > 
> > > > > The patch should probably have
> > > > >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for
> > > > > virtqueue")
> > > > > 
> > > > > , but I am not exactly sure why syzkaller only started
> > > > > triggering the
> > > > > bug this year, given that the patch dates back to 2023.
> > > > 
> > > > Yes that's probably a good idea. I will queue it with this tag.
> > > 
> > > Hi Michael,
> > > 
> > > Looks like the patch is still stuck in the limbo :(
> > 
> > It should be in linux next. Don't you see it there?
> 
> FWIW I ran linux-next with KMSAN today and this fix was already there.
> 
> But in the meantime another similarly looking issue crept in:
> 
> https://lore.kernel.org/netdev/20240712195759.GA2972562@myrica/T/

I remember picking up that fix for next, too. Not there?
Not at the testing box right now.

-- 
MST


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-07-15 16:06             ` Michael S. Tsirkin
@ 2024-07-15 16:32               ` Alexander Potapenko
  2024-07-15 20:11                 ` Michael S. Tsirkin
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Potapenko @ 2024-07-15 16:32 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Ilya Leoshkevich, Jason Wang, Xuan Zhuo, virtualization,
	Eugenio Pérez, Aleksandr Nogikh

On Mon, Jul 15, 2024 at 6:06 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Jul 15, 2024 at 05:30:49PM +0200, Ilya Leoshkevich wrote:
> > On Mon, 2024-07-15 at 10:20 -0400, Michael S. Tsirkin wrote:
> > > On Mon, Jul 15, 2024 at 03:24:17PM +0200, Alexander Potapenko wrote:
> > > > On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com>
> > > > wrote:
> > > > >
> > > > > On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko
> > > > > wrote:
> > > > > > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com>
> > > > > > wrote:
> > > > > > >
> > > > > > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo
> > > > > > > <xuanzhuo@linux.alibaba.com> wrote:
> > > > > > > >
> > > > > > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > > > > > >
> > > > > > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > > > > > >  receive_buf+0x45ca/0x6990
> > > > > > > >  virtnet_poll+0x17e0/0x3130
> > > > > > > >  net_rx_action+0x832/0x26e0
> > > > > > > >  handle_softirqs+0x330/0x10f0
> > > > > > > >  [...]
> > > > > > > >
> > > > > > > > Uninit was created at:
> > > > > > > >  __alloc_pages_noprof+0x62a/0xe60
> > > > > > > >  alloc_pages_noprof+0x392/0x830
> > > > > > > >  skb_page_frag_refill+0x21a/0x5c0
> > > > > > > >  virtnet_rq_alloc+0x50/0x1500
> > > > > > > >  try_fill_recv+0x372/0x54c0
> > > > > > > >  virtnet_open+0x210/0xbe0
> > > > > > > >  __dev_open+0x56e/0x920
> > > > > > > >  __dev_change_flags+0x39c/0x2000
> > > > > > > >  dev_change_flags+0xaa/0x200
> > > > > > > >  do_setlink+0x197a/0x7420
> > > > > > > >  rtnl_setlink+0x77c/0x860
> > > > > > > >  [...]
> > > > > > > >
> > > > > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > > > > > Tested-by: Alexander Potapenko <glider@google.com>
> > > > > > >
> > > > > > > Acked-by: Jason Wang <jasowang@redhat.com>
> > > > > >
> > > > > > Jason, Michael, any chance this patch can make it to 6.10?
> > > > > > The bug in question has essentially been blocking KMSAN on
> > > > > > syzbot for
> > > > > > the past month:
> > > > > > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> > > > > >
> > > > > > The patch should probably have
> > > > > >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for
> > > > > > virtqueue")
> > > > > >
> > > > > > , but I am not exactly sure why syzkaller only started
> > > > > > triggering the
> > > > > > bug this year, given that the patch dates back to 2023.
> > > > >
> > > > > Yes that's probably a good idea. I will queue it with this tag.
> > > >
> > > > Hi Michael,
> > > >
> > > > Looks like the patch is still stuck in the limbo :(
> > >
> > > It should be in linux next. Don't you see it there?

It's there, sorry for the confusion.
However the KMSAN builder doesn't test -next, so it will be down until
the fix(es) reach torvalds/linux.

> > FWIW I ran linux-next with KMSAN today and this fix was already there.
> >
> > But in the meantime another similarly looking issue crept in:
> >
> > https://lore.kernel.org/netdev/20240712195759.GA2972562@myrica/T/
>
> I remember picking up that fix for next, too. Not there?
> Not at the testing box right now.

I don't see the patch referenced by Ilya in linux-next/master either.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] virtio_ring: fix KMSAN error for premapped mode
  2024-07-15 16:32               ` Alexander Potapenko
@ 2024-07-15 20:11                 ` Michael S. Tsirkin
  0 siblings, 0 replies; 11+ messages in thread
From: Michael S. Tsirkin @ 2024-07-15 20:11 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: Ilya Leoshkevich, Jason Wang, Xuan Zhuo, virtualization,
	Eugenio Pérez, Aleksandr Nogikh

On Mon, Jul 15, 2024 at 06:32:52PM +0200, Alexander Potapenko wrote:
> On Mon, Jul 15, 2024 at 6:06 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Mon, Jul 15, 2024 at 05:30:49PM +0200, Ilya Leoshkevich wrote:
> > > On Mon, 2024-07-15 at 10:20 -0400, Michael S. Tsirkin wrote:
> > > > On Mon, Jul 15, 2024 at 03:24:17PM +0200, Alexander Potapenko wrote:
> > > > > On Mon, Jun 24, 2024 at 3:57 PM Michael S. Tsirkin <mst@redhat.com>
> > > > > wrote:
> > > > > >
> > > > > > On Mon, Jun 24, 2024 at 03:51:50PM +0200, Alexander Potapenko
> > > > > > wrote:
> > > > > > > On Fri, Jun 7, 2024 at 8:34 AM Jason Wang <jasowang@redhat.com>
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > On Thu, Jun 6, 2024 at 7:13 PM Xuan Zhuo
> > > > > > > > <xuanzhuo@linux.alibaba.com> wrote:
> > > > > > > > >
> > > > > > > > > Add kmsan for virtqueue_dma_map_single_attrs to fix:
> > > > > > > > >
> > > > > > > > > BUG: KMSAN: uninit-value in receive_buf+0x45ca/0x6990
> > > > > > > > >  receive_buf+0x45ca/0x6990
> > > > > > > > >  virtnet_poll+0x17e0/0x3130
> > > > > > > > >  net_rx_action+0x832/0x26e0
> > > > > > > > >  handle_softirqs+0x330/0x10f0
> > > > > > > > >  [...]
> > > > > > > > >
> > > > > > > > > Uninit was created at:
> > > > > > > > >  __alloc_pages_noprof+0x62a/0xe60
> > > > > > > > >  alloc_pages_noprof+0x392/0x830
> > > > > > > > >  skb_page_frag_refill+0x21a/0x5c0
> > > > > > > > >  virtnet_rq_alloc+0x50/0x1500
> > > > > > > > >  try_fill_recv+0x372/0x54c0
> > > > > > > > >  virtnet_open+0x210/0xbe0
> > > > > > > > >  __dev_open+0x56e/0x920
> > > > > > > > >  __dev_change_flags+0x39c/0x2000
> > > > > > > > >  dev_change_flags+0xaa/0x200
> > > > > > > > >  do_setlink+0x197a/0x7420
> > > > > > > > >  rtnl_setlink+0x77c/0x860
> > > > > > > > >  [...]
> > > > > > > > >
> > > > > > > > > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > > > > > > Tested-by: Alexander Potapenko <glider@google.com>
> > > > > > > >
> > > > > > > > Acked-by: Jason Wang <jasowang@redhat.com>
> > > > > > >
> > > > > > > Jason, Michael, any chance this patch can make it to 6.10?
> > > > > > > The bug in question has essentially been blocking KMSAN on
> > > > > > > syzbot for
> > > > > > > the past month:
> > > > > > > https://syzkaller.appspot.com/bug?id=2819883f3d376b703e686e700fde00a01eec62fa
> > > > > > >
> > > > > > > The patch should probably have
> > > > > > >   Fixes: b6253b4e21939 ("virtio_ring: introduce dma map api for
> > > > > > > virtqueue")
> > > > > > >
> > > > > > > , but I am not exactly sure why syzkaller only started
> > > > > > > triggering the
> > > > > > > bug this year, given that the patch dates back to 2023.
> > > > > >
> > > > > > Yes that's probably a good idea. I will queue it with this tag.
> > > > >
> > > > > Hi Michael,
> > > > >
> > > > > Looks like the patch is still stuck in the limbo :(
> > > >
> > > > It should be in linux next. Don't you see it there?
> 
> It's there, sorry for the confusion.
> However the KMSAN builder doesn't test -next, so it will be down until
> the fix(es) reach torvalds/linux.
> 
> > > FWIW I ran linux-next with KMSAN today and this fix was already there.
> > >
> > > But in the meantime another similarly looking issue crept in:
> > >
> > > https://lore.kernel.org/netdev/20240712195759.GA2972562@myrica/T/
> >
> > I remember picking up that fix for next, too. Not there?
> > Not at the testing box right now.
> 
> I don't see the patch referenced by Ilya in linux-next/master either.

Oh right, there was confusion with net-next.
Thanks for pointing this out.

-- 
MST


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-07-15 20:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 11:13 [PATCH] virtio_ring: fix KMSAN error for premapped mode Xuan Zhuo
2024-06-06 11:54 ` Ilya Leoshkevich
2024-06-07  6:34 ` Jason Wang
2024-06-24 13:51   ` Alexander Potapenko
2024-06-24 13:57     ` Michael S. Tsirkin
2024-07-15 13:24       ` Alexander Potapenko
2024-07-15 14:20         ` Michael S. Tsirkin
2024-07-15 15:30           ` Ilya Leoshkevich
2024-07-15 16:06             ` Michael S. Tsirkin
2024-07-15 16:32               ` Alexander Potapenko
2024-07-15 20:11                 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).