]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/sgx: remove checks for file execute permissions
authorDave Hansen <dave.hansen@linux.intel.com>
Mon, 21 Jun 2021 19:05:56 +0000 (12:05 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 24 Jun 2021 00:38:04 +0000 (18:38 -0600)
commit5ef1a0c3134206ae02917cb7190546e1a717642c
treeae453984f418dad7434d901a776790b9e96334ea
parent012ba5089d834e9cb3574a27e71b5e8b31cf6687
selftests/sgx: remove checks for file execute permissions

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: 95a9fbb82c24 ("selftests/sgx: Improve error detection and messages")
Reported-by: Tim Gardner <tim.gardner@canonical.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sgx@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/sgx/load.c