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 Sat, Mar 28, 2020 at 9:52 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> On Fri, Mar 27, 2020 at 07:46:08PM +0100, Alexander Potapenko wrote:
> > > > Do you mean comparing the address to TASK_SIZE, or is there a more
> > > > portable way to check that?
> > >
> > > !PageHighMem(page) implies the page has a kernel direct mapping.
> >
> > I tried adding this check and started seeing false positives because
> > the virtio_ring driver actually uses highmem pages for DMA, and data
> > from those pages is later copied to the kernel.
> > Guess it's easier to just allow handling highmem pages? What problems
> > do you anticipate?
>
> For PageHighMem(page), page_address(page) is not actually valid, so І'm
> not sure how your code in this patch even worked at all.  Note that
> all drivers (well, except for a few buggy legacy ones with workarounds)
> can DMA from/to highmem.

Hm, skipping PageHighMem pages works now, I must've been doing something wrong.
Thanks, will add that check to v6.

I found a bunch of other places in mm/kmsan/kmsan_shadow.c where we're
using page_address(), but metadata pages are not supposed to reside in
high memory.

-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg





[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