<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in load.c</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>b84fc2e0 - selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#b84fc2e0</link>
        <description>selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entryEnsure sym_tab and sym_names are zero-initialized and add an early-outcondition in the unlikely (erroneous) case that the enclave ELF file wouldnot contain a symbol table.This addresses -Werror=maybe-uninitialized compiler warnings for gcc -O2.Fixes: 33c5aac3bf32 (&quot;selftests/sgx: Test complete changing of page type flow&quot;)Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Link: https://lore.kernel.org/all/20231005153854.25566-3-jo.vanbulck%40cs.kuleuven.be

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Thu, 05 Oct 2023 15:38:43 +0000</pubDate>
        <dc:creator>Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;</dc:creator>
    </item>
<item>
        <title>33c5aac3 - selftests/sgx: Test complete changing of page type flow</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#33c5aac3</link>
        <description>selftests/sgx: Test complete changing of page type flowSupport for changing an enclave page&apos;s type enables an initializedenclave to be expanded with support for more threads by changing thetype of a regular enclave page to that of a Thread Control Structure(TCS).  Additionally, being able to change a TCS or regular enclavepage&apos;s type to be trimmed (SGX_PAGE_TYPE_TRIM) initiates the removalof the page from the enclave.Test changing page type to TCS as well as page removal flowsin two phases: In the first phase support for a new thread isdynamically added to an initialized enclave and in the second phasethe pages associated with the new thread are removed from the enclave.As an additional sanity check after the second phase the page used asa TCS page during the first phase is added back as a regular page andensured that it can be written to (which is not possible if it was aTCS page).Signed-off-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Acked-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Link: https://lkml.kernel.org/r/d05b48b00338683a94dcaef9f478540fc3d6d5f9.1652137848.git.reinette.chatre@intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Tue, 10 May 2022 18:09:03 +0000</pubDate>
        <dc:creator>Reinette Chatre &lt;reinette.chatre@intel.com&gt;</dc:creator>
    </item>
<item>
        <title>2d03861e - selftests/sgx: Fix NULL-pointer-dereference upon early test failure</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#2d03861e</link>
        <description>selftests/sgx: Fix NULL-pointer-dereference upon early test failure== Background ==The SGX selftests track parts of the enclave binaries in an array:encl-&gt;segment_tbl[]. That array is dynamically allocated early(but not first) in the test&apos;s lifetime. The array is referencedat the end of the test in encl_delete().== Problem ==encl-&gt;segment_tbl[] can be NULL if the test fails before itsallocation. That leads to a NULL-pointer-dereference in encl_delete().This is triggered during early failures of the selftest like if theenclave binary (&quot;test_encl.elf&quot;) is deleted.== Solution ==Ensure encl-&gt;segment_tbl[] is valid before attempting to accessits members. The offset with which it is accessed, encl-&gt;nr_segments,is initialized before encl-&gt;segment_tbl[] and thus considered validto use after the encl-&gt;segment_tbl[] check succeeds.Fixes: 3200505d4de6 (&quot;selftests/sgx: Create a heap for the test enclave&quot;)Signed-off-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Acked-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;Link: https://lkml.kernel.org/r/90a31dfd640ea756fa324712e7cbab4a90fa7518.1644355600.git.reinette.chatre@intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Tue, 08 Feb 2022 21:48:39 +0000</pubDate>
        <dc:creator>Reinette Chatre &lt;reinette.chatre@intel.com&gt;</dc:creator>
    </item>
<item>
        <title>3200505d - selftests/sgx: Create a heap for the test enclave</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#3200505d</link>
        <description>selftests/sgx: Create a heap for the test enclaveCreate a heap for the test enclave, which is allocated from /dev/null,and left unmeasured. This is beneficial by its own because it verifiesthat an enclave built from multiple choices, works properly. If LSMhooks are added for SGX some day, a multi source enclave has higherprobability to trigger bugs on access control checks.The immediate need comes from the need to implement page reclaim tests.In order to trigger the page reclaimer, one can just set the size ofthe heap to high enough.Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Acked-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Link: https://lkml.kernel.org/r/e070c5f23578c29608051cab879b1d276963a27a.1636997631.git.reinette.chatre@intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Mon, 15 Nov 2021 18:35:17 +0000</pubDate>
        <dc:creator>Jarkko Sakkinen &lt;jarkko@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>5f0ce664 - selftests/sgx: Make data measurement for an enclave segment optional</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#5f0ce664</link>
        <description>selftests/sgx: Make data measurement for an enclave segment optionalFor a heap makes sense to leave its contents &quot;unmeasured&quot; in the SGXenclave build process, meaning that they won&apos;t contribute to thecryptographic signature (a RSA-3072 signed SHA56 hash) of the enclave.Enclaves are signed blobs where the signature is calculated both frompage data and also from &quot;structural properties&quot; of the pages.  Forinstance a page offset of *every* page added to the enclave is hashed.For data, this is optional, not least because hashing a page has asignificant contribution to the enclave load time. Thus, where there isno reason to hash, do not. The SGX ioctl interface supports this withSGX_PAGE_MEASURE flag. Only when the flag is *set*, data is measured.Add seg-&gt;measure boolean flag to struct encl_segment. Only when theflag is set, include the segment data to the signature (representedby SIGSTRUCT architectural structure).Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Acked-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Link: https://lkml.kernel.org/r/625b6fe28fed76275e9238ec4e15ec3c0d87de81.1636997631.git.reinette.chatre@intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Mon, 15 Nov 2021 18:35:16 +0000</pubDate>
        <dc:creator>Jarkko Sakkinen &lt;jarkko@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>39f62536 - selftests/sgx: Assign source for each segment</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#39f62536</link>
        <description>selftests/sgx: Assign source for each segmentDefine source per segment so that enclave pages can be added from differentsources, e.g. anonymous VMA for zero pages. In other words, add &apos;src&apos; fieldto struct encl_segment, and assign it to &apos;encl-&gt;src&apos; for pages inheritedfrom the enclave binary.Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Acked-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Link: https://lkml.kernel.org/r/7850709c3089fe20e4bcecb8295ba87c54cc2b4a.1636997631.git.reinette.chatre@intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Mon, 15 Nov 2021 18:35:15 +0000</pubDate>
        <dc:creator>Jarkko Sakkinen &lt;jarkko@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>4896df9d - selftests/sgx: remove checks for file execute permissions</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#4896df9d</link>
        <description>selftests/sgx: remove checks for file execute permissionsThe SGX selftests can fail for a bunch of non-obvious reasonslike &apos;noexec&apos; permissions on /dev (which is the default *EVERYWHERE*it seems).A new test mistakenly also looked for +x permission on the/dev/sgx_enclave.  File execute permissions really only apply tothe ability of execve() to work on a file, *NOT* on the abilityfor an application to map the file with PROT_EXEC.  SGX needs tommap(PROT_EXEC), but doesn&apos;t need to execve() the device file.Remove the check.Fixes: 4284f7acb78b (&quot;selftests/sgx: Improve error detection and messages&quot;)Reported-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;Cc: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Cc: Shuah Khan &lt;shuah@kernel.org&gt;Cc: linux-sgx@vger.kernel.orgCc: linux-kselftest@vger.kernel.orgCc: linux-kernel@vger.kernel.orgTested-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Mon, 21 Jun 2021 19:05:56 +0000</pubDate>
        <dc:creator>Dave Hansen &lt;dave.hansen@linux.intel.com&gt;</dc:creator>
    </item>
<item>
        <title>235d1c9c - selftests/sgx: Migrate to kselftest harness</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#235d1c9c</link>
        <description>selftests/sgx: Migrate to kselftest harnessMigrate to kselftest harness. Use a fixture test with enclave initializedand de-initialized for each of the existing three tests, in other words:1. One FIXTURE() for managing the enclave life-cycle.2. Three TEST_F()&apos;s, one for each test case.Dump lines of /proc/self/maps matching &quot;sgx&quot; in FIXTURE_SETUP() as thiscan be very useful debugging information later on.Amended commit log:This migration changes the output of this test. Instead of skippingthe tests if open /dev/sgx_enclave fails, it will run all the testsand report failures on all of them.Shuah Khan &lt;skhan@linuxfoundation.org&gt;Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Thu, 10 Jun 2021 08:30:18 +0000</pubDate>
        <dc:creator>Jarkko Sakkinen &lt;jarkko@kernel.org&gt;</dc:creator>
    </item>
<item>
        <title>4284f7ac - selftests/sgx: Improve error detection and messages</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#4284f7ac</link>
        <description>selftests/sgx: Improve error detection and messagesThe SGX device file (/dev/sgx_enclave) is unusual in that it requiresexecute permissions.  It has to be both &quot;chmod +x&quot; *and* be on afilesystem without &apos;noexec&apos;.In the future, udev and systemd should get updates to set up systemsautomatically.  But, for now, nobody&apos;s systems do this automatically,and everybody gets error messages like this when running ./test_sgx:	0x0000000000000000 0x0000000000002000 0x03	0x0000000000002000 0x0000000000001000 0x05	0x0000000000003000 0x0000000000003000 0x03	mmap() failed, errno=1.That isn&apos;t very user friendly, even for forgetful kernel developers.Further, the test case is rather haphazard about its use of fprintf()versus perror().Improve the error messages.  Use perror() where possible.  Lastly,do some sanity checks on opening and mmap()ing the device file sothat we can get a decent error message out to the user.Now, if your user doesn&apos;t have permission, you&apos;ll get the following:	$ ls -l /dev/sgx_enclave	crw------- 1 root root 10, 126 Mar 18 11:29 /dev/sgx_enclave	$ ./test_sgx	Unable to open /dev/sgx_enclave: Permission deniedIf you then &apos;chown dave:dave /dev/sgx_enclave&apos; (or whatever), butyou leave execute permissions off, you&apos;ll get:	$ ls -l /dev/sgx_enclave	crw------- 1 dave dave 10, 126 Mar 18 11:29 /dev/sgx_enclave	$ ./test_sgx	no execute permissions on device fileIf you fix that with &quot;chmod ug+x /dev/sgx&quot; but you leave /dev asnoexec, you&apos;ll get this:	$ mount | grep &quot;/dev .*noexec&quot;	udev on /dev type devtmpfs (rw,nosuid,noexec,...)	$ ./test_sgx	ERROR: mmap for exec: Operation not permitted	mmap() succeeded for PROT_READ, but failed for PROT_EXEC	check that user has execute permissions on /dev/sgx_enclave and	that /dev does not have noexec set: &apos;mount | grep &quot;/dev .*noexec&quot;&apos;That can be fixed with:	mount -o remount,noexec /devESCHopefully, the combination of better error messages and the searchengines indexing this message will help people fix their systemsuntil we do this properly. [ bp: Improve error messages more. ]Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Link: https://lore.kernel.org/r/20210318194301.11D9A984@viggo.jf.intel.com

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Thu, 18 Mar 2021 19:43:01 +0000</pubDate>
        <dc:creator>Dave Hansen &lt;dave.hansen@linux.intel.com&gt;</dc:creator>
    </item>
<item>
        <title>2adcba79 - selftests/x86: Add a selftest for SGX</title>
        <link>http://172.16.0.5:8080/history/linux-6.15/tools/testing/selftests/sgx/load.c#2adcba79</link>
        <description>selftests/x86: Add a selftest for SGXAdd a selftest for SGX. It is a trivial test where a simple enclavecopies one 64-bit word of memory between two memory locations,but ensures that all SGX hardware and software infrastructure isfunctioning.Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;Acked-by: Jethro Beekman &lt;jethro@fortanix.com&gt;Cc: linux-kselftest@vger.kernel.orgLink: https://lkml.kernel.org/r/20201112220135.165028-21-jarkko@kernel.org

            List of files:
            /linux-6.15/tools/testing/selftests/sgx/load.c</description>
        <pubDate>Thu, 12 Nov 2020 22:01:31 +0000</pubDate>
        <dc:creator>Jarkko Sakkinen &lt;jarkko@kernel.org&gt;</dc:creator>
    </item>
</channel>
</rss>
