[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING
Hi Cristoph,

On Tue, 2021-11-02 at 07:41 +0100, Christoph Hellwig wrote:
> As others pointed out, DMA_ATTR_NO_KERNEL_MAPPING just means the
> caller can't rely on a kernel mapping. So the "fix" here is
> wrong. That being said for cases where we can easily remove a page
> from the kernel mapping it would be nice to do to:
> a) improve security
> b) as a debug check to see that no one actually tries to access it

I will modify my commit message. Thanks for your comment.

> > + /* remove kernel mapping for pages */
> > + set_memory_valid((unsigned
> > long)phys_to_virt(dma_to_phys(dev, *dma_handle)),
> Please avoid overly long lines. Also this function only exists for
> arm64
> also and others pointed out won't work for all cases.

Got it. I will send v2 patch.

Thanks for your review and suggestion.


 \ /
  Last update: 2021-11-02 08:09    [W:0.101 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site