kexec: new syscall kexec_file_load() declaration
authorVivek Goyal <vgoyal@redhat.com>
Fri, 8 Aug 2014 21:25:55 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:32 +0000 (15:57 -0700)
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>
arch/x86/syscalls/syscall_64.tbl
include/linux/syscalls.h
kernel/kexec.c
kernel/sys_ni.c

index ca2b9aa78c8180903998428c60f1523fa309f3b2..35dd922727b9a577a5de0108dd5f9d79cce4b9c1 100644 (file)
 317    common  seccomp                 sys_seccomp
 318    common  getrandom               sys_getrandom
 319    common  memfd_create            sys_memfd_create
+320    common  kexec_file_load         sys_kexec_file_load
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
index 15a069425cbf93732f6683fa2311a01b1f2658d0..0f86d85a9ce44cc771bb7118eb7b4cbc28ae905d 100644 (file)
@@ -317,6 +317,10 @@ asmlinkage long sys_restart_syscall(void);
 asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
                                struct kexec_segment __user *segments,
                                unsigned long flags);
+asmlinkage long sys_kexec_file_load(int kernel_fd, int initrd_fd,
+                                   unsigned long cmdline_len,
+                                   const char __user *cmdline_ptr,
+                                   unsigned long flags);
 
 asmlinkage long sys_exit(int error_code);
 asmlinkage long sys_exit_group(int error_code);
index bfdda316697de90cf4ad700d49ca783dd23bc0b3..ec4386c1b94fd805b8bee9d02c54839f273dc1eb 100644 (file)
@@ -1058,6 +1058,13 @@ COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry,
 }
 #endif
 
+SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
+               unsigned long, cmdline_len, const char __user *, cmdline_ptr,
+               unsigned long, flags)
+{
+       return -ENOSYS;
+}
+
 void crash_kexec(struct pt_regs *regs)
 {
        /* Take the kexec_mutex here to prevent sys_kexec_load
index 1f79e3714533e9ff3080013cafddb1e3697d318e..391d4ddb6f4bb7e83593841ada8096f9d20eae54 100644 (file)
@@ -25,6 +25,7 @@ cond_syscall(sys_swapon);
 cond_syscall(sys_swapoff);
 cond_syscall(sys_kexec_load);
 cond_syscall(compat_sys_kexec_load);
+cond_syscall(sys_kexec_file_load);
 cond_syscall(sys_init_module);
 cond_syscall(sys_finit_module);
 cond_syscall(sys_delete_module);