[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f862d0f-e851-0de3-a789-991448ed8b68@intel.com>
Date: Thu, 25 Aug 2022 10:38:23 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Sean Christopherson <seanjc@...gle.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, keescook@...omium.org
Subject: Re: [PATCH] x86/mm: Refuse W^X violations
On 8/25/22 10:18, Sean Christopherson wrote:
>> +/*
>> + * Validate and enforce strict W^X semantics.
>> + */
>> +static inline pgprot_t verify_rwx(pgprot_t old, pgprot_t new, unsigned long start,
>> + unsigned long pfn, unsigned long npg)
>> +{
>> + unsigned long end;
>> +
> I think this needs
>
> if (!(__supported_pte_mask & _PAGE_NX))
> return new;
>
> to play nice with non-PAE 32-bit kernels.
Good catch. Nit: I'd probably write this up as:
if (!cpu_feature_enabled(X86_FEATURE_NX))
return new;
That gets us our fancy static branches and is a bit easier on the eyes.
I checked and don't see a way for __supported_pte_mask to have _PAGE_NX
clear when X86_FEATURE_NX==1.
Powered by blists - more mailing lists