lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Sep 2021 08:50:03 -0700
From:   Reinette Chatre <reinette.chatre@...el.com>
To:     Dave Hansen <dave.hansen@...el.com>, <linux-sgx@...r.kernel.org>,
        <jarkko@...nel.org>, <shuah@...nel.org>
CC:     <seanjc@...gle.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
        <linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 12/14] selftests/sgx: Add page permission and exception
 test

Hi Dave,

On 9/16/2021 8:30 AM, Dave Hansen wrote:
> On 9/15/21 1:31 PM, Reinette Chatre wrote:
>> Add a test to ensure that (1) PTE permissions can be changed as long as
>> they do not exceed EPCM permissions, and (2) even if EPCM permissions
>> allow a page to be written to, if the PTE permissions do not then a #PF
>> should be generated when attempting to write to a (from PTE perspective)
>> read-only page.
> 
> It took me a minute to figure out what this was trying to say.

The goal was to describe what features/functionalities are being tested. 
You accurately point out that it is not clear how the test implemented 
in the patch matches with these test goals.

>  Maybe
> breaking it down into these three steps would help:
> 
> Add a test that:
>   (1) Creates an SGX enclave page with writable EPCM permission
>   (2) Changes the PTE permission on the page to read-only.  This should
>       be permitted because the permission does not exceed the EPCM
>       permission.
>   (3) Attempts a write to the page and generate a page fault (#PF)
>       because of the read-only PTE.

Thank you for the suggestion. What I understand from your feedback is 
that I should mix the description of the actual test with what 
features/functionalities are being tested. You do so in your suggestion 
for (2) and to do the same for (3) I now plan to expand it to:

    (3) Attempts a write to the page. This should generate a page fault
        (#PF) because of the read-only PTE even though the EPCM
        permissions allow the page to be written to.

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ