Bläddra i källkod

add new syscall numbers for seccomp, getrandom, memfd_create

these syscalls are new in linux v3.17 and present on all supported
archs except sh.

seccomp was added in commit 48dc92b9fc3926844257316e75ba11eb5c742b2c
it has operation, flags and pointer arguments (if flags==0 then it is
the same as prctl(PR_SET_SECCOMP,...)), the uapi header for flag
definitions is linux/seccomp.h

getrandom was added in commit c6e9d6f38894798696f23c8084ca7edbf16ee895
it provides an entropy source when open("/dev/urandom",..) would fail,
the uapi header for flags is linux/random.h

memfd_create was added in commit 9183df25fe7b194563db3fec6dc3202a5855839c
it allows anon mmap to have an fd, that can be shared, sealed and needs no
mount point, the uapi header for flags is linux/memfd.h
Szabolcs Nagy 10 år sedan
förälder
incheckning
4ffc39c654

+ 6 - 0
arch/arm/bits/syscall.h

@@ -336,6 +336,9 @@
 #define __NR_sched_setattr	380
 #define __NR_sched_getattr	381
 #define __NR_renameat2	382
+#define __NR_seccomp	383
+#define __NR_getrandom	384
+#define __NR_memfd_create	385
 
 
 /* Repeated with SYS_ prefix */
@@ -678,3 +681,6 @@
 #define SYS_sched_setattr	380
 #define SYS_sched_getattr	381
 #define SYS_renameat2	382
+#define SYS_seccomp	383
+#define SYS_getrandom	384
+#define SYS_memfd_create	385

+ 6 - 0
arch/i386/bits/syscall.h

@@ -352,6 +352,9 @@
 #define __NR_sched_setattr	351
 #define __NR_sched_getattr	352
 #define __NR_renameat2		353
+#define __NR_seccomp		354
+#define __NR_getrandom		355
+#define __NR_memfd_create	356
 
 
 /* Repeated with SYS_ prefix */
@@ -710,3 +713,6 @@
 #define SYS_sched_setattr	351
 #define SYS_sched_getattr	352
 #define SYS_renameat2		353
+#define SYS_seccomp		354
+#define SYS_getrandom		355
+#define SYS_memfd_create	356

+ 8 - 0
arch/microblaze/bits/syscall.h

@@ -377,6 +377,10 @@
 #define __NR_finit_module 380
 #define __NR_sched_setattr 381
 #define __NR_sched_getattr 382
+#define __NR_renameat2 383
+#define __NR_seccomp 384
+#define __NR_getrandom 385
+#define __NR_memfd_create 386
 
 /* Repeated with SYS_ prefix */
 
@@ -760,3 +764,7 @@
 #define SYS_finit_module 380
 #define SYS_sched_setattr 381
 #define SYS_sched_getattr 382
+#define SYS_renameat2 383
+#define SYS_seccomp 384
+#define SYS_getrandom 385
+#define SYS_memfd_create 386

+ 6 - 0
arch/mips/bits/syscall.h

@@ -349,6 +349,9 @@
 #define __NR_sched_setattr           4349
 #define __NR_sched_getattr           4350
 #define __NR_renameat2               4351
+#define __NR_seccomp                 4352
+#define __NR_getrandom               4353
+#define __NR_memfd_create            4354
 
 
 /* Repeated with SYS_ prefix */
@@ -703,3 +706,6 @@
 #define SYS_sched_setattr           4349
 #define SYS_sched_getattr           4350
 #define SYS_renameat2               4351
+#define SYS_seccomp                 4352
+#define SYS_getrandom               4353
+#define SYS_memfd_create            4354

+ 6 - 0
arch/or1k/bits/syscall.h

@@ -260,6 +260,9 @@
 #define __NR_sched_setattr 274
 #define __NR_sched_getattr 275
 #define __NR_renameat2 276
+#define __NR_seccomp 277
+#define __NR_getrandom 278
+#define __NR_memfd_create 279
 
 #define SYS_io_setup __NR_io_setup
 #define SYS_io_destroy __NR_io_destroy
@@ -523,3 +526,6 @@
 #define SYS_sched_setattr __NR_sched_setattr
 #define SYS_sched_getattr __NR_sched_getattr
 #define SYS_renameat2 __NR_renameat2
+#define SYS_seccomp __NR_seccomp
+#define SYS_getrandom __NR_getrandom
+#define SYS_memfd_create __NR_memfd_create

+ 6 - 0
arch/powerpc/bits/syscall.h

@@ -371,6 +371,9 @@
 #define __NR_sched_setattr         355
 #define __NR_sched_getattr         356
 #define __NR_renameat2             357
+#define __NR_seccomp               358
+#define __NR_getrandom             359
+#define __NR_memfd_create          360
 
 /*
  * repeated with SYS prefix
@@ -748,3 +751,6 @@
 #define SYS_sched_setattr         355
 #define SYS_sched_getattr         356
 #define SYS_renameat2             357
+#define SYS_seccomp               358
+#define SYS_getrandom             359
+#define SYS_memfd_create          360

+ 6 - 0
arch/x32/bits/syscall.h

@@ -274,6 +274,9 @@
 #define __NR_sched_setattr (__X32_SYSCALL_BIT + 314)
 #define __NR_sched_getattr (__X32_SYSCALL_BIT + 315)
 #define __NR_renameat2 (__X32_SYSCALL_BIT + 316)
+#define __NR_seccomp (__X32_SYSCALL_BIT + 317)
+#define __NR_getrandom (__X32_SYSCALL_BIT + 318)
+#define __NR_memfd_create (__X32_SYSCALL_BIT + 319)
 
 #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
 #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
@@ -598,6 +601,9 @@
 #define SYS_sched_setattr __NR_sched_setattr
 #define SYS_sched_getattr __NR_sched_getattr
 #define SYS_renameat2 __NR_renameat2
+#define SYS_seccomp __NR_seccomp
+#define SYS_getrandom __NR_getrandom
+#define SYS_memfd_create __NR_memfd_create
 
 #define SYS_rt_sigaction __NR_rt_sigaction
 #define SYS_rt_sigreturn __NR_rt_sigreturn

+ 6 - 0
arch/x86_64/bits/syscall.h

@@ -315,6 +315,9 @@
 #define __NR_sched_setattr			314
 #define __NR_sched_getattr			315
 #define __NR_renameat2				316
+#define __NR_seccomp				317
+#define __NR_getrandom				318
+#define __NR_memfd_create			319
 
 
 #undef __NR_fstatat
@@ -648,6 +651,9 @@
 #define SYS_sched_setattr			314
 #define SYS_sched_getattr			315
 #define SYS_renameat2				316
+#define SYS_seccomp				317
+#define SYS_getrandom				318
+#define SYS_memfd_create			319
 
 #undef SYS_fstatat
 #undef SYS_pread