lkml.org 
[lkml]   [2018]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] x86, pti: filter at vma->vm_page_prot population
From
Date
On 04/20/2018 06:21 PM, Nadav Amit wrote:
>> pgprot_t vm_get_page_prot(unsigned long vm_flags)
>> {
>> - return __pgprot(pgprot_val(protection_map[vm_flags &
>> + pgprot_t ret = __pgprot(pgprot_val(protection_map[vm_flags &
>> (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]) |
>> pgprot_val(arch_vm_get_page_prot(vm_flags)));
>> +
>> + return arch_filter_pgprot(ret);
>> }
>> EXPORT_SYMBOL(vm_get_page_prot);
> Wouldn’t it be simpler or at least cleaner to change the protection map if
> NX is not supported? I presume it can be done paging_init() similarly to the
> way other archs (e.g., arm, mips) do.

I thought about it, but doing it there requires getting the _timing_
right. You have to do it before the protection map gets used but after
__supported_pte_mask is totally initialized. This seemed more
straightforward, especially as a bug fix.

What you are talking about might be a good cleanup, though.

\
 
 \ /
  Last update: 2018-04-23 13:37    [W:0.722 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site