Skip to content

Commit 749730c

Browse files
Alexei Starovoitovdavem330
authored andcommitted
bpf: enable bpf syscall on x64 and i386
done as separate commit to ease conflict resolution Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 99c55f7 commit 749730c

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

arch/x86/syscalls/syscall_32.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,4 @@
363363
354 i386 seccomp sys_seccomp
364364
355 i386 getrandom sys_getrandom
365365
356 i386 memfd_create sys_memfd_create
366+
357 i386 bpf sys_bpf

arch/x86/syscalls/syscall_64.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
318 common getrandom sys_getrandom
328328
319 common memfd_create sys_memfd_create
329329
320 common kexec_file_load sys_kexec_file_load
330+
321 common bpf sys_bpf
330331

331332
#
332333
# x32-specific system call numbers start at 512 to avoid cache impact

include/linux/syscalls.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct old_linux_dirent;
6565
struct perf_event_attr;
6666
struct file_handle;
6767
struct sigaltstack;
68+
union bpf_attr;
6869

6970
#include <linux/types.h>
7071
#include <linux/aio_abi.h>
@@ -875,5 +876,5 @@ asmlinkage long sys_seccomp(unsigned int op, unsigned int flags,
875876
const char __user *uargs);
876877
asmlinkage long sys_getrandom(char __user *buf, size_t count,
877878
unsigned int flags);
878-
879+
asmlinkage long sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
879880
#endif

include/uapi/asm-generic/unistd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,11 @@ __SYSCALL(__NR_seccomp, sys_seccomp)
705705
__SYSCALL(__NR_getrandom, sys_getrandom)
706706
#define __NR_memfd_create 279
707707
__SYSCALL(__NR_memfd_create, sys_memfd_create)
708+
#define __NR_bpf 280
709+
__SYSCALL(__NR_bpf, sys_bpf)
708710

709711
#undef __NR_syscalls
710-
#define __NR_syscalls 280
712+
#define __NR_syscalls 281
711713

712714
/*
713715
* All syscalls below here should go away really,

kernel/sys_ni.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,6 @@ cond_syscall(sys_kcmp);
218218

219219
/* operate on Secure Computing state */
220220
cond_syscall(sys_seccomp);
221+
222+
/* access BPF programs and maps */
223+
cond_syscall(sys_bpf);

0 commit comments

Comments
 (0)