Patch "selftests/sgx: remove checks for file execute permissions" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/sgx: remove checks for file execute permissions

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-sgx-remove-checks-for-file-execute-permiss.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 32dcdb205ecadc4a87e84efe54fec60c1968353b
Author: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Date:   Mon Jun 21 12:05:56 2021 -0700

    selftests/sgx: remove checks for file execute permissions
    
    [ Upstream commit 4896df9d53ae5521f3ce83751e828ad70bc65c80 ]
    
    The SGX selftests can fail for a bunch of non-obvious reasons
    like 'noexec' 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 to
    the ability of execve() to work on a file, *NOT* on the ability
    for an application to map the file with PROT_EXEC.  SGX needs to
    mmap(PROT_EXEC), but doesn't need to execve() the device file.
    
    Remove the check.
    
    Fixes: 4284f7acb78b ("selftests/sgx: Improve error detection and messages")
    Reported-by: Tim Gardner <tim.gardner@xxxxxxxxxxxxx>
    Cc: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Cc: Reinette Chatre <reinette.chatre@xxxxxxxxx>
    Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
    Cc: Shuah Khan <shuah@xxxxxxxxxx>
    Cc: linux-sgx@xxxxxxxxxxxxxxx
    Cc: linux-kselftest@xxxxxxxxxxxxxxx
    Cc: linux-kernel@xxxxxxxxxxxxxxx
    Tested-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
    Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
    Reviewed-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c
index f441ac34b4d4..bae78c3263d9 100644
--- a/tools/testing/selftests/sgx/load.c
+++ b/tools/testing/selftests/sgx/load.c
@@ -150,16 +150,6 @@ bool encl_load(const char *path, struct encl *encl)
 		goto err;
 	}
 
-	/*
-	 * This just checks if the /dev file has these permission
-	 * bits set.  It does not check that the current user is
-	 * the owner or in the owning group.
-	 */
-	if (!(sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
-		fprintf(stderr, "no execute permissions on device file %s\n", device_path);
-		goto err;
-	}
-
 	ptr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0);
 	if (ptr == (void *)-1) {
 		perror("mmap for read");
@@ -169,13 +159,13 @@ bool encl_load(const char *path, struct encl *encl)
 
 #define ERR_MSG \
 "mmap() succeeded for PROT_READ, but failed for PROT_EXEC.\n" \
-" Check that current user has execute permissions on %s and \n" \
-" that /dev does not have noexec set: mount | grep \"/dev .*noexec\"\n" \
+" Check that /dev does not have noexec set:\n" \
+" \tmount | grep \"/dev .*noexec\"\n" \
 " If so, remount it executable: mount -o remount,exec /dev\n\n"
 
 	ptr = mmap(NULL, PAGE_SIZE, PROT_EXEC, MAP_SHARED, fd, 0);
 	if (ptr == (void *)-1) {
-		fprintf(stderr, ERR_MSG, device_path);
+		fprintf(stderr, ERR_MSG);
 		goto err;
 	}
 	munmap(ptr, PAGE_SIZE);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux