[PATCH] dma: kmsan: Export kmsan_handle_dma() for modules.

Sebastian Andrzej Siewior posted 1 patch 10 months ago
mm/kmsan/hooks.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] dma: kmsan: Export kmsan_handle_dma() for modules.
Posted by Sebastian Andrzej Siewior 10 months ago
kmsan_handle_dma() is used by virtio_ring() which can be built as a
module. kmsan_handle_dma() needs to be exported otherwise building the
virtio_ring fails.

Export kmsan_handle_dma for modules.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502150634.qjxwSeJR-lkp@intel.com/
Fixes: 7ade4f10779cb ("dma: kmsan: unpoison DMA mappings")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mm/kmsan/hooks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c
index 3ea50f09311fd..3df45c25c1f62 100644
--- a/mm/kmsan/hooks.c
+++ b/mm/kmsan/hooks.c
@@ -357,6 +357,7 @@ void kmsan_handle_dma(struct page *page, size_t offset, size_t size,
 		size -= to_go;
 	}
 }
+EXPORT_SYMBOL_GPL(kmsan_handle_dma);
 
 void kmsan_handle_dma_sg(struct scatterlist *sg, int nents,
 			 enum dma_data_direction dir)
-- 
2.47.2
Re: [PATCH] dma: kmsan: Export kmsan_handle_dma() for modules.
Posted by Andrew Morton 10 months ago
On Tue, 18 Feb 2025 10:14:11 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> kmsan_handle_dma() is used by virtio_ring() which can be built as a
> module. kmsan_handle_dma() needs to be exported otherwise building the
> virtio_ring fails.
> 
> Export kmsan_handle_dma for modules.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502150634.qjxwSeJR-lkp@intel.com/
> Fixes: 7ade4f10779cb ("dma: kmsan: unpoison DMA mappings")

It's strange that this took a few years to be noticed.

Thanks, I added cc:stable to this.
Re: [PATCH] dma: kmsan: Export kmsan_handle_dma() for modules.
Posted by Alexander Potapenko 10 months ago
On Tue, Feb 18, 2025 at 10:14 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> kmsan_handle_dma() is used by virtio_ring() which can be built as a
> module. kmsan_handle_dma() needs to be exported otherwise building the
> virtio_ring fails.
>
> Export kmsan_handle_dma for modules.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502150634.qjxwSeJR-lkp@intel.com/
> Fixes: 7ade4f10779cb ("dma: kmsan: unpoison DMA mappings")
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Alexander Potapenko <glider@google.com>