aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-08-08 17:25:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:32 -0400
commitf0895685c7fd8c938c91a9d8a6f7c11f22df58d2 (patch)
treeee4ddc38c68addf2e0c0ed77f6be53e2521c93e6
parent815d5704a337a662bf960757edbff7a0680d40fd (diff)
kexec: new syscall kexec_file_load() declaration
This is the new syscall kexec_file_load() declaration/interface. I have reserved the syscall number only for x86_64 so far. Other architectures (including i386) can reserve syscall number when they enable the support for this new syscall. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Borislav Petkov <bp@suse.de> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/x86/syscalls/syscall_64.tbl1
-rw-r--r--include/linux/syscalls.h4
-rw-r--r--kernel/kexec.c7
-rw-r--r--kernel/sys_ni.c1
4 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
index ca2b9aa78c81..35dd922727b9 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -326,6 +326,7 @@
326317 common seccomp sys_seccomp 326317 common seccomp sys_seccomp
327318 common getrandom sys_getrandom 327318 common getrandom sys_getrandom
328319 common memfd_create sys_memfd_create 328319 common memfd_create sys_memfd_create
329320 common kexec_file_load sys_kexec_file_load
329 330
330# 331#
331# x32-specific system call numbers start at 512 to avoid cache impact 332# x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 15a069425cbf..0f86d85a9ce4 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -317,6 +317,10 @@ asmlinkage long sys_restart_syscall(void);
317asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, 317asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
318 struct kexec_segment __user *segments, 318 struct kexec_segment __user *segments,
319 unsigned long flags); 319 unsigned long flags);
320asmlinkage long sys_kexec_file_load(int kernel_fd, int initrd_fd,
321 unsigned long cmdline_len,
322 const char __user *cmdline_ptr,
323 unsigned long flags);
320 324
321asmlinkage long sys_exit(int error_code); 325asmlinkage long sys_exit(int error_code);
322asmlinkage long sys_exit_group(int error_code); 326asmlinkage long sys_exit_group(int error_code);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index bfdda316697d..ec4386c1b94f 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1058,6 +1058,13 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry,
1058} 1058}
1059#endif 1059#endif
1060 1060
1061SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
1062 unsigned long, cmdline_len, const char __user *, cmdline_ptr,
1063 unsigned long, flags)
1064{
1065 return -ENOSYS;
1066}
1067
1061void crash_kexec(struct pt_regs *regs) 1068void crash_kexec(struct pt_regs *regs)
1062{ 1069{
1063 /* Take the kexec_mutex here to prevent sys_kexec_load 1070 /* Take the kexec_mutex here to prevent sys_kexec_load
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 1f79e3714533..391d4ddb6f4b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -25,6 +25,7 @@ cond_syscall(sys_swapon);
25cond_syscall(sys_swapoff); 25cond_syscall(sys_swapoff);
26cond_syscall(sys_kexec_load); 26cond_syscall(sys_kexec_load);
27cond_syscall(compat_sys_kexec_load); 27cond_syscall(compat_sys_kexec_load);
28cond_syscall(sys_kexec_file_load);
28cond_syscall(sys_init_module); 29cond_syscall(sys_init_module);
29cond_syscall(sys_finit_module); 30cond_syscall(sys_finit_module);
30cond_syscall(sys_delete_module); 31cond_syscall(sys_delete_module);