OpenCloudOS-Kernel/drivers/virtio
Xuan Zhuo c5b30148ef virtio_ring: fix KMSAN error for premapped mode
[ Upstream commit 840b2d39a2dc1b96deb3f5c7fef76c9b24f08f51 ]

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>
Message-Id: <20240606111345.93600-1-xuanzhuo@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>  # s390x
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:11:36 +02:00
..
Kconfig virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
Makefile virtio: replace restricted mem access flag with callback 2022-08-01 07:42:49 +02:00
virtio.c virtio: reenable config if freezing device failed 2024-04-03 15:28:36 +02:00
virtio_anchor.c virtio: replace restricted mem access flag with callback 2022-08-01 07:42:49 +02:00
virtio_balloon.c virtio_balloon: Fix endless deflation and inflation on arm64 2023-10-18 11:29:35 -04:00
virtio_dma_buf.c dma-buf: move dma-buf symbols into the DMA_BUF module namespace 2021-10-25 14:53:08 +02:00
virtio_input.c virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
virtio_mem.c virtio-mem: check if the config changed before fake offlining memory 2023-08-10 15:51:46 -04:00
virtio_mmio.c virtio-mmio: fix memory leak of vm_dev 2023-10-18 11:29:09 -04:00
virtio_pci_common.c virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-12 11:12:49 +02:00
virtio_pci_common.h virtio_pci: Optimize virtio_pci_device structure size 2023-06-27 10:47:08 -04:00
virtio_pci_legacy.c virtio-pci: Fix legacy device flag setting error in probe 2023-08-10 15:24:28 -04:00
virtio_pci_legacy_dev.c virtio/virtio_pci_legacy_dev: ensure the correct return value 2022-01-14 18:50:53 -05:00
virtio_pci_modern.c virtio: add VIRTIO_F_NOTIFICATION_DATA feature support 2023-04-21 03:02:35 -04:00
virtio_pci_modern_dev.c virtio_pci: fix the common cfg map size 2023-10-18 11:30:12 -04:00
virtio_ring.c virtio_ring: fix KMSAN error for premapped mode 2024-09-12 11:11:36 +02:00
virtio_vdpa.c virtio_vdpa: build affinity masks conditionally 2023-09-03 18:10:24 -04:00