[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200220221038.GA26618@linux.intel.com>
Date: Fri, 21 Feb 2020 00:10:38 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Jordan Hand <jorhand@...ux.microsoft.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-sgx@...r.kernel.org, akpm@...ux-foundation.org,
dave.hansen@...el.com, sean.j.christopherson@...el.com,
nhorman@...hat.com, npmccallum@...hat.com, haitao.huang@...el.com,
andriy.shevchenko@...ux.intel.com, tglx@...utronix.de,
kai.svahn@...el.com, bp@...en8.de, josh@...htriplett.org,
luto@...nel.org, kai.huang@...el.com, rientjes@...gle.com,
cedric.xing@...el.com, puiterwijk@...hat.com,
linux-security-module@...r.kernel.org,
Suresh Siddha <suresh.b.siddha@...el.com>,
Haitao Huang <haitao.huang@...ux.intel.com>
Subject: Re: [PATCH v26 10/22] x86/sgx: Linux Enclave Driver
On Tue, Feb 18, 2020 at 07:26:31PM -0800, Jordan Hand wrote:
> if (!page || (~page->vm_max_prot_bits & vm_prot_bits))
> return -EACCESS
>
> This means that for any process where READ_IMPLIES_EXECUTE is set and
> page where (vma->vm_flags & VM_MAYEXEC) == true, mmap/mprotect calls to
> that request PROT_READ on a page that was not added with PROT_EXEC will
> fail.
Right. You would end up requesting RX from a R region.
And you are suggesting that we tweak it along the lines of to make RIE
processes work:
unsigned long max_prot_bits = page->vm_max_prot_bits;
if (!!(current->personality & READ_IMPLIES_EXEC) &&
vma->vm_flags & VM_MAY_EXEC)
max_prot_bits |= VM_EXEC;
/* ... */
if (!page || (~max_prot_bits & vm_prot_bits))
return -EACCESS
?
/Jarkko
Powered by blists - more mailing lists