From 4ffc39c65448b04685946dffa68745cf0f6bf9f7 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 1 Oct 2014 21:41:47 +0200 Subject: [PATCH] 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 --- arch/arm/bits/syscall.h | 6 ++++++ arch/i386/bits/syscall.h | 6 ++++++ arch/microblaze/bits/syscall.h | 8 ++++++++ arch/mips/bits/syscall.h | 6 ++++++ arch/or1k/bits/syscall.h | 6 ++++++ arch/powerpc/bits/syscall.h | 6 ++++++ arch/x32/bits/syscall.h | 6 ++++++ arch/x86_64/bits/syscall.h | 6 ++++++ 8 files changed, 50 insertions(+) diff --git a/arch/arm/bits/syscall.h b/arch/arm/bits/syscall.h index efbdafff..d1b1c99c 100644 --- a/arch/arm/bits/syscall.h +++ b/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 diff --git a/arch/i386/bits/syscall.h b/arch/i386/bits/syscall.h index e1bfe6c2..7584f30d 100644 --- a/arch/i386/bits/syscall.h +++ b/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 diff --git a/arch/microblaze/bits/syscall.h b/arch/microblaze/bits/syscall.h index b8b1d2e3..f0ed204b 100644 --- a/arch/microblaze/bits/syscall.h +++ b/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 diff --git a/arch/mips/bits/syscall.h b/arch/mips/bits/syscall.h index dfce41f6..03a4926c 100644 --- a/arch/mips/bits/syscall.h +++ b/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 diff --git a/arch/or1k/bits/syscall.h b/arch/or1k/bits/syscall.h index dfb1a8bc..4e3b5c98 100644 --- a/arch/or1k/bits/syscall.h +++ b/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 diff --git a/arch/powerpc/bits/syscall.h b/arch/powerpc/bits/syscall.h index 277e223a..6d96acde 100644 --- a/arch/powerpc/bits/syscall.h +++ b/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 diff --git a/arch/x32/bits/syscall.h b/arch/x32/bits/syscall.h index 4bbe3d29..fc4146e9 100644 --- a/arch/x32/bits/syscall.h +++ b/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 diff --git a/arch/x86_64/bits/syscall.h b/arch/x86_64/bits/syscall.h index 9048273c..245d6471 100644 --- a/arch/x86_64/bits/syscall.h +++ b/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 -- 2.25.1