[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb39b6af-5921-64e8-793b-5ef4b150153e@linuxfoundation.org>
Date: Fri, 11 Jun 2021 16:45:19 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Jarkko Sakkinen <jarkko@...nel.org>, shuah@...nel.org
Cc: linux-kselftest@...r.kernel.org, linux-sgx@...r.kernel.org,
Reinette Chatre <reinette.chatre@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
linux-kernel@...r.kernel.org,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v8 3/5] selftests/sgx: Dump enclave memory map
On 6/10/21 2:30 AM, Jarkko Sakkinen wrote:
> Often, it's useful to check whether /proc/self/maps looks sane when
> dealing with memory mapped objects, especially when they are JIT'ish
> dynamically constructed objects. Therefore, dump "/dev/sgx_enclave"
> matching lines from the memory map in FIXTURE_SETUP().
>
> Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
> ---
> tools/testing/selftests/sgx/main.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/tools/testing/selftests/sgx/main.c b/tools/testing/selftests/sgx/main.c
> index 6da19b6bf287..14030f8b85ff 100644
> --- a/tools/testing/selftests/sgx/main.c
> +++ b/tools/testing/selftests/sgx/main.c
> @@ -117,6 +117,8 @@ FIXTURE_SETUP(enclave)
> Elf64_Sym *sgx_enter_enclave_sym = NULL;
> struct vdso_symtab symtab;
> struct encl_segment *seg;
> + char maps_line[256];
> + FILE *maps_file;
> unsigned int i;
> void *addr;
>
> @@ -167,6 +169,18 @@ FIXTURE_SETUP(enclave)
> memset(&self->run, 0, sizeof(self->run));
> self->run.tcs = self->encl.encl_base;
>
> + maps_file = fopen("/proc/self/maps", "r");
I almost applied these. Does this require root access, if so,
please add logic to skip the test if non-root user runs it.
Same comments for all other paths that might require root access.
thanks,
-- Shuah
Powered by blists - more mailing lists