Re: [PATCH 3/4] x86/mm: Inhibit _PAGE_NX changes from cpa_process_alias()

From: Dave Hansen
Date: Mon Nov 14 2022 - 11:08:22 EST


On 11/10/22 04:52, Peter Zijlstra wrote:
> There is a cludge in change_page_attr_set_clr() that inhibits
> propagating NX changes to the aliases (directmap and highmap) -- this
> is a cludge twofold:
>
> - it also inhibits the primary checks in __change_page_attr();
> - it hard depends on single bit changes.
>
> The introduction of set_memory_rox() triggered this last issue for
> clearing both _PAGE_RW and _PAGE_NX.
>
> Explicitly ignore _PAGE_NX in cpa_process_alias() instead.
>
> Fixes: b38994948567 ("x86/mm: Implement native set_memory_rox()")
> Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
> Debugged-by: Dave Hansen <dave.hansen@xxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Looks sane. It's also nice how the checkalias stuff continues to fall
out of there.

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxx>