Re: [PATCH v5 34/38] kmsan: dma: unpoison memory mapped by dma_direct_map_page()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 25, 2020 at 05:12:45PM +0100, glider@xxxxxxxxxx wrote:
> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
> index a8560052a915f..63dc1a594964a 100644
> --- a/kernel/dma/direct.c
> +++ b/kernel/dma/direct.c
> @@ -367,6 +367,7 @@ dma_addr_t dma_direct_map_page(struct device *dev, struct page *page,
>  			     &dma_addr, size, *dev->dma_mask, dev->bus_dma_limit);
>  		return DMA_MAPPING_ERROR;
>  	}
> +	kmsan_handle_dma(page_address(page) + offset, size, dir);

This needs to go into dma_map_page so that it also covers IOMMUs.
dma_map_sg_atttrs will also need similar treatment.  Also the page
doesn't have to be mapped into kernel address space, you probably
want to pass the page to kmsan_handle_dma and throw in a highmem
check there.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux