Skip to content

Commit 4159080

Browse files
authored
Merge pull request #4330 from mbuesch/seccomp-more-consts
seccomp: Add more constants from seccomp.h
2 parents 9d20e56 + 97432d1 commit 4159080

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

libc-test/semver/android.txt

+9
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

+1
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

+20-7
Original file line numberDiff line numberDiff line change
@@ -2158,18 +2158,22 @@ pub const GRND_NONBLOCK: c_uint = 0x0001;
21582158
pub const GRND_RANDOM: c_uint = 0x0002;
21592159
pub const GRND_INSECURE: c_uint = 0x0004;
21602160

2161+
// <linux/seccomp.h>
21612162
pub const SECCOMP_MODE_DISABLED: c_uint = 0;
21622163
pub const SECCOMP_MODE_STRICT: c_uint = 1;
21632164
pub const SECCOMP_MODE_FILTER: c_uint = 2;
21642165

2165-
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1;
2166-
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2;
2167-
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4;
2168-
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8;
2166+
pub const SECCOMP_SET_MODE_STRICT: c_uint = 0;
2167+
pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
2168+
pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
2169+
pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
21692170

2170-
pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
2171-
pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
2172-
pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
2171+
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
2172+
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
2173+
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
2174+
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
2175+
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
2176+
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
21732177

21742178
pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
21752179
pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
@@ -2181,6 +2185,15 @@ pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
21812185
pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
21822186
pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;
21832187

2188+
pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000;
2189+
pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000;
2190+
pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff;
2191+
2192+
pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: c_ulong = 1;
2193+
2194+
pub const SECCOMP_ADDFD_FLAG_SETFD: c_ulong = 1;
2195+
pub const SECCOMP_ADDFD_FLAG_SEND: c_ulong = 2;
2196+
21842197
pub const NLA_F_NESTED: c_int = 1 << 15;
21852198
pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14;
21862199
pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);

src/unix/linux_like/linux/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -3246,18 +3246,19 @@ pub const SECCOMP_SET_MODE_FILTER: c_uint = 1;
32463246
pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2;
32473247
pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3;
32483248

3249-
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1;
3250-
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2;
3251-
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4;
3252-
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8;
3253-
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 16;
3254-
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 32;
3249+
pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1 << 0;
3250+
pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 1 << 1;
3251+
pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 1 << 2;
3252+
pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 1 << 3;
3253+
pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 1 << 4;
3254+
pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 1 << 5;
32553255

32563256
pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000;
32573257
pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000;
32583258
pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD;
32593259
pub const SECCOMP_RET_TRAP: c_uint = 0x00030000;
32603260
pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000;
3261+
pub const SECCOMP_RET_USER_NOTIF: c_uint = 0x7fc00000;
32613262
pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000;
32623263
pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000;
32633264
pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000;

0 commit comments

Comments
 (0)