diff options
author | Dmitry V. Levin <ldv@strace.io> | 2023-04-22 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-04-28 08:00:00 +0000 |
commit | 0919375f95e381e353221b19521e715dda739f98 (patch) | |
tree | 988eb2b5460d24370dd5068bf18b6e780d3c51ca | |
parent | 468698a0813536f81449491ab9430fbdf196858c (diff) | |
download | strace-0919375f95e381e353221b19521e715dda739f98.tar.gz |
xlat: update MFD_* constants
* src/xlat/memfd_create_flags.in (MFD_NOEXEC_SEAL, MFD_EXEC): New
constants introduced by Linux kernel commit v6.3-rc1~113^2~502.
* tests/memfd_create.c (main): Update expected output.
* NEWS: Mention this.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/xlat/memfd_create_flags.in | 2 | ||||
-rw-r--r-- | tests/memfd_create.c | 11 |
3 files changed, 9 insertions, 6 deletions
@@ -9,7 +9,7 @@ Noteworthy changes in release ?.? (????-??-??) * Implemented decoding of IFLA_BRPORT_MCAST_N_GROUPS, IFLA_BRPORT_MCAST_MAX_GROUPS, IFLA_GSO_IPV4_MAX_SIZE, and IFLA_GRO_IPV4_MAX_SIZE netlink attributes. - * Updated lists of F_SEAL_*, IFLA_*, IORING_*, and IP_* constants. + * Updated lists of F_SEAL_*, IFLA_*, IORING_*, IP_*, and MFD_* constants. * Updated lists of ioctl commands from Linux 6.3. Noteworthy changes in release 6.2 (2023-02-26) diff --git a/src/xlat/memfd_create_flags.in b/src/xlat/memfd_create_flags.in index 28a79b2e8..e61eeaa5f 100644 --- a/src/xlat/memfd_create_flags.in +++ b/src/xlat/memfd_create_flags.in @@ -2,3 +2,5 @@ MFD_CLOEXEC MFD_ALLOW_SEALING MFD_HUGETLB +MFD_NOEXEC_SEAL +MFD_EXEC diff --git a/tests/memfd_create.c b/tests/memfd_create.c index df4dbbf19..c9fc82927 100644 --- a/tests/memfd_create.c +++ b/tests/memfd_create.c @@ -37,19 +37,20 @@ main(void) printf("memfd_create(\"%.*s\"..., 0) = %s\n", (int) size, pattern, errstr); - kernel_ulong_t flags = (kernel_ulong_t) 0xfacefeed00000007ULL; -#define flags1_str "MFD_CLOEXEC|MFD_ALLOW_SEALING|MFD_HUGETLB" + kernel_ulong_t flags = (kernel_ulong_t) 0xfacefeed0000001fULL; +#define flags1_str \ + "MFD_CLOEXEC|MFD_ALLOW_SEALING|MFD_HUGETLB|MFD_NOEXEC_SEAL|MFD_EXEC" k_memfd_create((uintptr_t) pattern, flags); #if XLAT_VERBOSE printf("memfd_create(\"%.*s\"..., %s /* %s */) = %s\n", (int) size, pattern, - "0x7", flags1_str, errstr); + "0x1f", flags1_str, errstr); #else printf("memfd_create(\"%.*s\"..., %s) = %s\n", (int) size, pattern, # if XLAT_RAW - "0x7", + "0x1f", # else flags1_str, # endif @@ -72,7 +73,7 @@ main(void) flags = (kernel_ulong_t) -1ULL; k_memfd_create(0, flags); - flags = -1U & ~(7 | (MFD_HUGE_MASK << MFD_HUGE_SHIFT)); + flags = -1U & ~(0x1f | (MFD_HUGE_MASK << MFD_HUGE_SHIFT)); #define memfd_create_fmt "%s|%#x|%u<<MFD_HUGE_SHIFT" |