Re: [PATCH] mm/pkey: Add PKEY_UNRESTRICTED macro

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

 



On 22/10/2024 16:04, Dave Hansen wrote:
> On 10/22/24 05:01, Yury Khrustalev wrote:
>> diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h
>> index 6ce1f1ceb432..ea40e27e6dea 100644
>> --- a/include/uapi/asm-generic/mman-common.h
>> +++ b/include/uapi/asm-generic/mman-common.h
>> @@ -82,6 +82,7 @@
>>  /* compatibility flags */
>>  #define MAP_FILE	0
>>  
>> +#define PKEY_UNRESTRICTED	0x0
>>  #define PKEY_DISABLE_ACCESS	0x1
>>  #define PKEY_DISABLE_WRITE	0x2
>>  #define PKEY_ACCESS_MASK	(PKEY_DISABLE_ACCESS |\
> It seems sane, but it would be nice to have at least site or two use it
> in the kernel so show that it's useful in practice.  Is there any kernel
> code or anything in selftests/ that would be improved with this?

As a matter of fact this would improve the readability of [1] quite a
bit: all those set_pkey_bits(..., 0) calls would become
set_pkey_bits(..., PKEY_UNRESTRICTED). I'm sure other pkey-related
kselftests could benefit too.

Kevin

[1]
https://lore.kernel.org/linux-arm-kernel/20241017133909.3837547-5-kevin.brodsky@xxxxxxx/




[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