Skip to content

Commit 2e4a84e

Browse files
rusty-snaketgross35
authored andcommitted
Add MFD_NOEXEC_SEAL and MFD_EXEC
(apply <rust-lang#3553> to `main`) (cherry picked from commit 8b68569)
1 parent e19650d commit 2e4a84e

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,6 +3821,10 @@ fn test_linux(target: &str) {
38213821
if name.starts_with("NI_IDN") {
38223822
return true;
38233823
}
3824+
// FIXME: Requires >= 6.3 kernel headers
3825+
if name == "MFD_NOEXEC_SEAL" || name == "MFD_EXEC" {
3826+
return true;
3827+
}
38243828
}
38253829
match name {
38263830
// These constants are not available if gnu headers have been included

libc-test/semver/android.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,9 @@ MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
12511251
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ
12521252
MFD_ALLOW_SEALING
12531253
MFD_CLOEXEC
1254+
MFD_EXEC
12541255
MFD_HUGETLB
1256+
MFD_NOEXEC_SEAL
12551257
MINIX2_SUPER_MAGIC
12561258
MINIX2_SUPER_MAGIC2
12571259
MINIX_SUPER_MAGIC

libc-test/semver/linux.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,9 @@ MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE
14651465
MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ
14661466
MFD_ALLOW_SEALING
14671467
MFD_CLOEXEC
1468+
MFD_EXEC
14681469
MFD_HUGETLB
1470+
MFD_NOEXEC_SEAL
14691471
MINSIGSTKSZ
14701472
MMAP_PAGE_ZERO
14711473
MNT_DETACH

src/unix/linux_like/android/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,6 +2255,8 @@ pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
22552255
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
22562256
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
22572257
pub const MFD_HUGETLB: ::c_uint = 0x0004;
2258+
pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
2259+
pub const MFD_EXEC: ::c_uint = 0x0010;
22582260
pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
22592261
pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
22602262
pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;

src/unix/linux_like/linux/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,8 @@ pub const CMSPAR: ::tcflag_t = 0o10000000000;
28122812
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
28132813
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
28142814
pub const MFD_HUGETLB: ::c_uint = 0x0004;
2815+
pub const MFD_NOEXEC_SEAL: ::c_uint = 0x0008;
2816+
pub const MFD_EXEC: ::c_uint = 0x0010;
28152817
pub const MFD_HUGE_64KB: ::c_uint = 0x40000000;
28162818
pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000;
28172819
pub const MFD_HUGE_1MB: ::c_uint = 0x50000000;

0 commit comments

Comments
 (0)