lkml.org 
[lkml]   [2017]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 03/10] swiotlb: Map the buffer if it was unmapped by XPFO
From
Date
On 09/20/2017 03:47 PM, Tycho Andersen wrote:
>
>>> static inline void *skcipher_map(struct scatter_walk *walk)
>>> {
>>> struct page *page = scatterwalk_page(walk);
>>>
>>> return (PageHighMem(page) ? kmap_atomic(page) : page_address(page)) +
>>> offset_in_page(walk->offset);
>>> }
>> Is there any better way to catch these? Like, can we add some debugging
>> to check for XPFO pages in __va()?
> Yes, and perhaps also a debugging check in PageHighMem?

I'm not sure what PageHighMem() would check. It's OK to use as long as
you don't depend on the contents of the page.

> Would __va have caught either of the two cases you've pointed out?
Yes. __va() is what is eventually called by lowmem_page_address(),
which is only OK to call on things that are actually mapped into the kernel.

\
 
 \ /
  Last update: 2017-09-21 19:24    [W:0.430 / U:1.224 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site