virtio-kmsan-check-unpoison-scatterlist-in-vring_map_one_sg.patch removed from -mm tree
The quilt patch titled
Subject: virtio: kmsan: check/unpoison scatterlist in vring_map_one_sg()
has been removed from the -mm tree. Its filename was
virtio-kmsan-check-unpoison-scatterlist-in-vring_map_one_sg.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Alexander Potapenko <[email protected]>
Subject: virtio: kmsan: check/unpoison scatterlist in vring_map_one_sg()
Date: Thu, 15 Sep 2022 17:03:56 +0200
If vring doesn't use the DMA API, KMSAN is unable to tell whether the memory is initialized by hardware. Explicitly call kmsan_handle_dma() from vring_map_one_sg() in this case to prevent false positives.
---
drivers/virtio/virtio_ring.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/virtio/virtio_ring.c renamed from drivers/virtio/virtio_ring.c~virtio-kmsan-check-unpoison-scatterlist-in-vring_map_one_sg +9 -1
@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/hrtimer.h> #include <linux/dma-mapping.h> +#include <linux/kmsan.h> #include <linux/spinlock.h> #include <xen/xen.h>
@@ -352,8 +353,15 @@ static dma_addr_t vring_map_one_sg(const struct scatterlist *sg, enum dma_data_direction direction) { -if (!vq->use_dma_api) +if (!vq->use_dma_api) { +/* +* If DMA is not used, KMSAN doesn't know that the scatterlist +* is initialized by the hardware. Explicitly check/unpoison it +* depending on the direction. +*/ +kmsan_handle_dma (sg_page (sg), sg->offset, sg->length, direction);return (dma_addr_t )sg_phys (sg); + }/* * We can't use dma_map_sg, because we don't use scatterlists in
_
Patches currently in -mm which might be from [email protected] are