Skip to content

Commit bbb331a

Browse files
mbueschtgross35
authored andcommitted
seccomp: Add more constants from seccomp.h
and align Android + Linux (backport <rust-lang#4330>) (cherry picked from commit 97432d1)
1 parent b28fef8 commit bbb331a

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

libc-test/semver/android.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,10 +2226,16 @@ SCM_CREDENTIALS
22262226
SCM_RIGHTS
22272227
SCM_TIMESTAMP
22282228
SCM_TIMESTAMPING
2229+
SECCOMP_ADDFD_FLAG_SEND
2230+
SECCOMP_ADDFD_FLAG_SETFD
22292231
SECCOMP_FILTER_FLAG_LOG
22302232
SECCOMP_FILTER_FLAG_NEW_LISTENER
22312233
SECCOMP_FILTER_FLAG_SPEC_ALLOW
22322234
SECCOMP_FILTER_FLAG_TSYNC
2235+
SECCOMP_FILTER_FLAG_TSYNC_ESRCH
2236+
SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
2237+
SECCOMP_GET_ACTION_AVAIL
2238+
SECCOMP_GET_NOTIF_SIZES
22332239
SECCOMP_MODE_DISABLED
22342240
SECCOMP_MODE_FILTER
22352241
SECCOMP_MODE_STRICT
@@ -2245,6 +2251,9 @@ SECCOMP_RET_LOG
22452251
SECCOMP_RET_TRACE
22462252
SECCOMP_RET_TRAP
22472253
SECCOMP_RET_USER_NOTIF
2254+
SECCOMP_SET_MODE_FILTER
2255+
SECCOMP_SET_MODE_STRICT
2256+
SECCOMP_USER_NOTIF_FLAG_CONTINUE
22482257
SEEK_CUR
22492258
SEEK_DATA
22502259
SEEK_END

libc-test/semver/linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,6 +2749,7 @@ SECCOMP_RET_KILL_THREAD
27492749
SECCOMP_RET_LOG
27502750
SECCOMP_RET_TRACE
27512751
SECCOMP_RET_TRAP
2752+
SECCOMP_RET_USER_NOTIF
27522753
SECCOMP_SET_MODE_FILTER
27532754
SECCOMP_SET_MODE_STRICT
27542755
SECCOMP_USER_NOTIF_FLAG_CONTINUE

src/unix/linux_like/android/mod.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,18 +2200,22 @@ pub const GRND_NONBLOCK: c_uint = 0x0001;
22002200
pub const GRND_RANDOM: c_uint = 0x0002;
22012201
pub const GRND_INSECURE: c_uint = 0x0004;
22022202

2203+
// <linux/seccomp.h>
22032204
pub const SECCOMP_MODE_DISABLED: c_uint = 0;
22042205
pub const SECCOMP_MODE_STRICT: c_uint = 1;
22052206
pub const SECCOMP_MODE_FILTER: c_uint = 2;
22062207

2207-
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1;
2208-
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2;
2209-
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4;
2210-
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8;
2208+
pub const SECCOMP_SET_MODE_STRICT: c_uint = 0;
2209+
pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
2210+
pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
2211+
pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
22112212

2212-
pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
2213-
pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
2214-
pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
2213+
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
2214+
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
2215+
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
2216+
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
2217+
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
2218+
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
22152219

22162220
pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
22172221
pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
@@ -2223,6 +2227,15 @@ pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
22232227
pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
22242228
pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;
22252229

2230+
pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
2231+
pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
2232+
pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
2233+
2234+
pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: c_ulong = 1;
2235+
2236+
pub const SECCOMP_ADDFD_FLAG_SETFD: c_ulong = 1;
2237+
pub const SECCOMP_ADDFD_FLAG_SEND: c_ulong = 2;
2238+
22262239
pub const NLA_F_NESTED: c_int = 1 << 15;
22272240
pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14;
22282241
pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);

src/unix/linux_like/linux/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3285,18 +3285,19 @@ pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
32853285
pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
32863286
pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
32873287

3288-
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1;
3289-
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2;
3290-
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4;
3291-
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8;
3292-
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 16;
3293-
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 32;
3288+
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
3289+
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
3290+
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
3291+
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
3292+
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
3293+
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
32943294

32953295
pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
32963296
pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
32973297
pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD;
32983298
pub const SECCOMP_RET_TRAP: c_uint = 0x00030000;
32993299
pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000;
3300+
pub const SECCOMP_RET_USER_NOTIF: c_uint = 0x7fc00000;
33003301
pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
33013302
pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
33023303
pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;

0 commit comments

Comments
 (0)