| From b1c4dc1ba255fb1eac6f11532bdb8d41173624df Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Date: Wed, 10 Aug 2022 13:07:37 +0200 |
| Subject: [PATCH 2/4] arch: wire up the readfile syscall |
| |
| This wires up the readfile syscall for all architectures |
| |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| arch/alpha/kernel/syscalls/syscall.tbl | 1 + |
| arch/arm/tools/syscall.tbl | 1 + |
| arch/arm64/include/asm/unistd.h | 2 +- |
| arch/arm64/include/asm/unistd32.h | 2 ++ |
| arch/ia64/kernel/syscalls/syscall.tbl | 1 + |
| arch/m68k/kernel/syscalls/syscall.tbl | 1 + |
| arch/microblaze/kernel/syscalls/syscall.tbl | 1 + |
| arch/mips/kernel/syscalls/syscall_n32.tbl | 1 + |
| arch/mips/kernel/syscalls/syscall_n64.tbl | 1 + |
| arch/mips/kernel/syscalls/syscall_o32.tbl | 1 + |
| arch/parisc/kernel/syscalls/syscall.tbl | 1 + |
| arch/powerpc/kernel/syscalls/syscall.tbl | 1 + |
| arch/s390/kernel/syscalls/syscall.tbl | 1 + |
| arch/sh/kernel/syscalls/syscall.tbl | 1 + |
| arch/sparc/kernel/syscalls/syscall.tbl | 1 + |
| arch/x86/entry/syscalls/syscall_32.tbl | 1 + |
| arch/x86/entry/syscalls/syscall_64.tbl | 1 + |
| arch/xtensa/kernel/syscalls/syscall.tbl | 1 + |
| include/linux/syscalls.h | 2 ++ |
| include/uapi/asm-generic/unistd.h | 5 ++++- |
| 20 files changed, 25 insertions(+), 2 deletions(-) |
| |
| --- a/arch/alpha/kernel/syscalls/syscall.tbl |
| +++ b/arch/alpha/kernel/syscalls/syscall.tbl |
| @@ -490,3 +490,4 @@ |
| 558 common process_mrelease sys_process_mrelease |
| 559 common futex_waitv sys_futex_waitv |
| 560 common set_mempolicy_home_node sys_ni_syscall |
| +561 common readfile sys_readfile |
| --- a/arch/arm/tools/syscall.tbl |
| +++ b/arch/arm/tools/syscall.tbl |
| @@ -464,3 +464,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/arm64/include/asm/unistd.h |
| +++ b/arch/arm64/include/asm/unistd.h |
| @@ -39,7 +39,7 @@ |
| #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) |
| #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) |
| |
| -#define __NR_compat_syscalls 451 |
| +#define __NR_compat_syscalls 452 |
| #endif |
| |
| #define __ARCH_WANT_SYS_CLONE |
| --- a/arch/arm64/include/asm/unistd32.h |
| +++ b/arch/arm64/include/asm/unistd32.h |
| @@ -907,6 +907,8 @@ __SYSCALL(__NR_process_mrelease, sys_pro |
| __SYSCALL(__NR_futex_waitv, sys_futex_waitv) |
| #define __NR_set_mempolicy_home_node 450 |
| __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node) |
| +#define __NR_readfile 451 |
| +__SYSCALL(__NR_readfile, sys_readfile) |
| |
| /* |
| * Please add new compat syscalls above this comment and update |
| --- a/arch/ia64/kernel/syscalls/syscall.tbl |
| +++ b/arch/ia64/kernel/syscalls/syscall.tbl |
| @@ -371,3 +371,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/m68k/kernel/syscalls/syscall.tbl |
| +++ b/arch/m68k/kernel/syscalls/syscall.tbl |
| @@ -450,3 +450,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/microblaze/kernel/syscalls/syscall.tbl |
| +++ b/arch/microblaze/kernel/syscalls/syscall.tbl |
| @@ -456,3 +456,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/mips/kernel/syscalls/syscall_n32.tbl |
| +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl |
| @@ -389,3 +389,4 @@ |
| 448 n32 process_mrelease sys_process_mrelease |
| 449 n32 futex_waitv sys_futex_waitv |
| 450 n32 set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 n32 readfile sys_readfile |
| --- a/arch/mips/kernel/syscalls/syscall_n64.tbl |
| +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl |
| @@ -365,3 +365,4 @@ |
| 448 n64 process_mrelease sys_process_mrelease |
| 449 n64 futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 n64 readfile sys_readfile |
| --- a/arch/mips/kernel/syscalls/syscall_o32.tbl |
| +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl |
| @@ -438,3 +438,4 @@ |
| 448 o32 process_mrelease sys_process_mrelease |
| 449 o32 futex_waitv sys_futex_waitv |
| 450 o32 set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 o32 readfile sys_readfile |
| --- a/arch/parisc/kernel/syscalls/syscall.tbl |
| +++ b/arch/parisc/kernel/syscalls/syscall.tbl |
| @@ -448,3 +448,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/powerpc/kernel/syscalls/syscall.tbl |
| +++ b/arch/powerpc/kernel/syscalls/syscall.tbl |
| @@ -537,3 +537,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/s390/kernel/syscalls/syscall.tbl |
| +++ b/arch/s390/kernel/syscalls/syscall.tbl |
| @@ -453,3 +453,4 @@ |
| 448 common process_mrelease sys_process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile sys_readfile |
| --- a/arch/sh/kernel/syscalls/syscall.tbl |
| +++ b/arch/sh/kernel/syscalls/syscall.tbl |
| @@ -453,3 +453,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/sparc/kernel/syscalls/syscall.tbl |
| +++ b/arch/sparc/kernel/syscalls/syscall.tbl |
| @@ -496,3 +496,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/arch/x86/entry/syscalls/syscall_32.tbl |
| +++ b/arch/x86/entry/syscalls/syscall_32.tbl |
| @@ -455,3 +455,4 @@ |
| 448 i386 process_mrelease sys_process_mrelease |
| 449 i386 futex_waitv sys_futex_waitv |
| 450 i386 set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 i386 readfile sys_readfile |
| --- a/arch/x86/entry/syscalls/syscall_64.tbl |
| +++ b/arch/x86/entry/syscalls/syscall_64.tbl |
| @@ -372,6 +372,7 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| |
| # |
| # Due to a historical design error, certain syscalls are numbered differently |
| --- a/arch/xtensa/kernel/syscalls/syscall.tbl |
| +++ b/arch/xtensa/kernel/syscalls/syscall.tbl |
| @@ -421,3 +421,4 @@ |
| 448 common process_mrelease sys_process_mrelease |
| 449 common futex_waitv sys_futex_waitv |
| 450 common set_mempolicy_home_node sys_set_mempolicy_home_node |
| +451 common readfile sys_readfile |
| --- a/include/linux/syscalls.h |
| +++ b/include/linux/syscalls.h |
| @@ -1058,6 +1058,8 @@ asmlinkage long sys_memfd_secret(unsigne |
| asmlinkage long sys_set_mempolicy_home_node(unsigned long start, unsigned long len, |
| unsigned long home_node, |
| unsigned long flags); |
| +asmlinkage long sys_readfile(int dfd, const char __user *filename, |
| + char __user *buffer, size_t bufsize, int flags); |
| |
| /* |
| * Architecture-specific system calls |
| --- a/include/uapi/asm-generic/unistd.h |
| +++ b/include/uapi/asm-generic/unistd.h |
| @@ -886,8 +886,11 @@ __SYSCALL(__NR_futex_waitv, sys_futex_wa |
| #define __NR_set_mempolicy_home_node 450 |
| __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node) |
| |
| +#define __NR_readfile 451 |
| +__SYSCALL(__NR_readfile, sys_readfile) |
| + |
| #undef __NR_syscalls |
| -#define __NR_syscalls 451 |
| +#define __NR_syscalls 452 |
| |
| /* |
| * 32 bit systems traditionally used different |