Question about PTE_CONT in linux_4.10

Ard Biesheuvel ard.biesheuvel at linaro.org
Mon Feb 13 00:13:41 PST 2017


On 13 February 2017 at 08:04, Wangxuefeng (E) <wxf.wang at hisilicon.com> wrote:
> Hi Jeremy,
>
>         I has a question about change access permission(X-executable) in linux_4.10 when continuous bit enable.
>         In linux_4.10, the memories allocated by kmalloc are always set PTE_PXN and PTE_CONT. When I need change the access permission of the kmalloc area to make it has executable permission(clear PXN), what interface can I use?
>     The set_memory_x only change the PTE_PXN, but it doesn't change continuous bit. If only a 4K page change the permission, TLB conflict will happen. Is there any other interface can change the permission?
>

set_memory_x() can only be used on vmalloc/vmap regions, which don't
use PTE_CONT. Does set_memory_x() work for you on kmalloc allocations?
If so, that is a bug and we should fix it



More information about the linux-arm-kernel mailing list