Re: [PATCH v2 3/3] selftests/powerpc/mm: Use PKEY_UNRESTRICTED macro

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

 



On 27/10/2024 18:00, Yury Khrustalev wrote:
> Replace literal 0 with macro PKEY_UNRESTRICTED where pkey_*() functions
> are used in mm selftests for memory protection keys for ppc target.
>
> Note that I couldn't build these tests so I would appreciate if someone
> could check this patch. Thank you!

This shouldn't be in the commit message presumably (you could add it
below ---). More importantly the ppc folks need to be cc'ed,
get_maintainer.pl is telling me that means at least:

linuxppc-dev@xxxxxxxxxxxxxxxx
Michael Ellerman <mpe@xxxxxxxxxxxxxx>

> Signed-off-by: Yury Khrustalev <yury.khrustalev@xxxxxxx>
> Suggested-by: Kevin Brodsky <kevin.brodsky@xxxxxxx>
> ---
>  tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 +-
>  tools/testing/selftests/powerpc/mm/pkey_siginfo.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> index 0af4f02669a1..29b91b7456eb 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_exec_prot.c
> @@ -72,7 +72,7 @@ static void segv_handler(int signum, siginfo_t *sinfo, void *ctx)
>  
>  		switch (fault_type) {
>  		case PKEY_DISABLE_ACCESS:
> -			pkey_set_rights(fault_pkey, 0);
> +			pkey_set_rights(fault_pkey, PKEY_UNRESTRICTED);
>  			break;
>  		case PKEY_DISABLE_EXECUTE:
>  			/*
> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> index 2db76e56d4cb..e89a164c686b 100644
> --- a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c
> @@ -83,7 +83,7 @@ static void segv_handler(int signum, siginfo_t *sinfo, void *ctx)
>  	    mprotect(pgstart, pgsize, PROT_EXEC))
>  		_exit(1);
>  	else
> -		pkey_set_rights(pkey, 0);
> +		pkey_set_rights(pkey, PKEY_UNRESTRICTED);
>  
>  	fault_count++;
>  }

Patch 2 made me realise there are quite a few sys_pkey_alloc(0, 0) calls
in the ppc tests, those could be converted as well.

Kevin





[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux