]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
get rid of pt_regs argument of ->load_binary()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 21 Oct 2012 02:00:48 +0000 (22:00 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 29 Nov 2012 02:53:38 +0000 (21:53 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 files changed:
arch/alpha/kernel/binfmt_loader.c
arch/x86/ia32/ia32_aout.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/binfmt_em86.c
fs/binfmt_flat.c
fs/binfmt_misc.c
fs/binfmt_script.c
fs/binfmt_som.c
fs/exec.c
include/linux/binfmts.h

index 54abbef5d077172154fb7aa9f692acba78d0cf2a..9525660c93c0f1808c9180cb382d142e88ae3bb2 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/binfmts.h>
 #include <linux/a.out.h>
 
-static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+static int load_binary(struct linux_binprm *bprm)
 {
        struct exec *eh = (struct exec *)bprm->buf;
        unsigned long loader;
index 07b3a68d2d291ab4c8582a1cc5121c6443e208bb..a703af19c281884b7114dd3e3f708584d1f99866 100644 (file)
@@ -35,7 +35,7 @@
 #undef WARN_OLD
 #undef CORE_DUMP /* definitely broken */
 
-static int load_aout_binary(struct linux_binprm *, struct pt_regs *regs);
+static int load_aout_binary(struct linux_binprm *);
 static int load_aout_library(struct file *);
 
 #ifdef CORE_DUMP
@@ -260,9 +260,10 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
  * These are the functions used to load a.out style executables and shared
  * libraries.  There is no binary dependent code anywhere else.
  */
-static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+static int load_aout_binary(struct linux_binprm *bprm)
 {
        unsigned long error, fd_offset, rlim;
+       struct pt_regs *regs = current_pt_regs();
        struct exec ex;
        int retval;
 
index 0e7a6f81ae36c0d9b57b36550ea58705675bd9f1..6043567b95c23ae5f97e1c9dadae7a17707219df 100644 (file)
@@ -30,7 +30,7 @@
 #include <asm/cacheflush.h>
 #include <asm/a.out-core.h>
 
-static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
+static int load_aout_binary(struct linux_binprm *);
 static int load_aout_library(struct file*);
 
 #ifdef CONFIG_COREDUMP
@@ -201,8 +201,9 @@ static unsigned long __user *create_aout_tables(char __user *p, struct linux_bin
  * libraries.  There is no binary dependent code anywhere else.
  */
 
-static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
+static int load_aout_binary(struct linux_binprm * bprm)
 {
+       struct pt_regs *regs = current_pt_regs();
        struct exec ex;
        unsigned long error;
        unsigned long fd_offset;
index fbd9f60bd763310c452a08dbb34fc8bbf2515560..6d7d1647a68c8cf3f8b2c906eb77e23040a49bf5 100644 (file)
@@ -44,7 +44,7 @@
 #define user_siginfo_t siginfo_t
 #endif
 
-static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
+static int load_elf_binary(struct linux_binprm *bprm);
 static int load_elf_library(struct file *);
 static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *,
                                int, int, unsigned long);
@@ -558,7 +558,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
 #endif
 }
 
-static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+static int load_elf_binary(struct linux_binprm *bprm)
 {
        struct file *interpreter = NULL; /* to shut gcc up */
        unsigned long load_addr = 0, load_bias = 0;
@@ -575,6 +575,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        unsigned long reloc_func_desc __maybe_unused = 0;
        int executable_stack = EXSTACK_DEFAULT;
        unsigned long def_flags = 0;
+       struct pt_regs *regs = current_pt_regs();
        struct {
                struct elfhdr elf_ex;
                struct elfhdr interp_elf_ex;
index a46049154107f549eaf3c987cab594db730116f4..dc84732e554f679dee6de0d95e7eab2b5bcda5b9 100644 (file)
@@ -56,7 +56,7 @@ typedef char *elf_caddr_t;
 
 MODULE_LICENSE("GPL");
 
-static int load_elf_fdpic_binary(struct linux_binprm *, struct pt_regs *);
+static int load_elf_fdpic_binary(struct linux_binprm *);
 static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *, struct file *);
 static int elf_fdpic_map_file(struct elf_fdpic_params *, struct file *,
                              struct mm_struct *, const char *);
@@ -164,10 +164,10 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params,
 /*
  * load an fdpic binary into various bits of memory
  */
-static int load_elf_fdpic_binary(struct linux_binprm *bprm,
-                                struct pt_regs *regs)
+static int load_elf_fdpic_binary(struct linux_binprm *bprm)
 {
        struct elf_fdpic_params exec_params, interp_params;
+       struct pt_regs *regs = current_pt_regs();
        struct elf_phdr *phdr;
        unsigned long stack_size, entryaddr;
 #ifdef ELF_FDPIC_PLAT_INIT
index 7e125718a75ec71c6db477ddd9690946ab4846b9..4e6cce57d113539f482b17db2931204f679d451b 100644 (file)
@@ -22,7 +22,7 @@
 #define EM86_INTERP    "/usr/bin/em86"
 #define EM86_I_NAME    "em86"
 
-static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
+static int load_em86(struct linux_binprm *bprm)
 {
        char *interp, *i_name, *i_arg;
        struct file * file;
index e280352b28f9e48adab2cc8d94963b0cbaf8b181..b56371981d16c009b0165bf44e4b3532c9de2467 100644 (file)
@@ -88,7 +88,7 @@ struct lib_info {
 static int load_flat_shared_library(int id, struct lib_info *p);
 #endif
 
-static int load_flat_binary(struct linux_binprm *, struct pt_regs * regs);
+static int load_flat_binary(struct linux_binprm *);
 static int flat_core_dump(struct coredump_params *cprm);
 
 static struct linux_binfmt flat_format = {
@@ -858,9 +858,10 @@ out:
  * libraries.  There is no binary dependent code anywhere else.
  */
 
-static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
+static int load_flat_binary(struct linux_binprm * bprm)
 {
        struct lib_info libinfo;
+       struct pt_regs *regs = current_pt_regs();
        unsigned long p = bprm->p;
        unsigned long stack_len;
        unsigned long start_addr;
index 226aeac22ac9fbfc728ed8902235e8170a9cbf7c..b0b70fbea06cb03e1adfe854a987f01bbf9956a9 100644 (file)
@@ -104,7 +104,7 @@ static Node *check_file(struct linux_binprm *bprm)
 /*
  * the loader itself
  */
-static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+static int load_misc_binary(struct linux_binprm *bprm)
 {
        Node *fmt;
        struct file * interp_file = NULL;
index 798b729f01d5e2e420f390fa64e123139b1e7f90..8c954997e7f73a22b39718a9564c0c9ed3465a58 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/err.h>
 #include <linux/fs.h>
 
-static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
+static int load_script(struct linux_binprm *bprm)
 {
        const char *i_arg, *i_name;
        char *cp;
index 4517aaff61b4b874df51113698524fc20d44578c..4e00ed68d4a6a606ed8b14383322bc833ebec9c8 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <linux/elf.h>
 
-static int load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs);
+static int load_som_binary(struct linux_binprm * bprm);
 static int load_som_library(struct file *);
 
 /*
@@ -180,13 +180,14 @@ out:
  */
 
 static int
-load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
+load_som_binary(struct linux_binprm * bprm)
 {
        int retval;
        unsigned int size;
        unsigned long som_entry;
        struct som_hdr *som_ex;
        struct som_exec_auxhdr *hpuxhdr;
+       struct pt_regs *regs = current_pt_regs();
 
        /* Get the exec-header */
        som_ex = (struct som_hdr *) bprm->buf;
index 2aee7ef10663cf651e76adfa20ebbd2c7216dd10..721a299295117f92d271f17afd224db1787712a1 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1374,13 +1374,13 @@ int search_binary_handler(struct linux_binprm *bprm)
        for (try=0; try<2; try++) {
                read_lock(&binfmt_lock);
                list_for_each_entry(fmt, &formats, lh) {
-                       int (*fn)(struct linux_binprm *, struct pt_regs *) = fmt->load_binary;
+                       int (*fn)(struct linux_binprm *) = fmt->load_binary;
                        if (!fn)
                                continue;
                        if (!try_module_get(fmt->module))
                                continue;
                        read_unlock(&binfmt_lock);
-                       retval = fn(bprm, current_pt_regs());
+                       retval = fn(bprm);
                        /*
                         * Restore the depth counter to its starting value
                         * in this call, so we don't have to rely on every
index 1f6ce133b4c1be42e93ce30435e06e051d8fd5cb..2630c9b41a8680c9411475f99b6f81f3efdc4f79 100644 (file)
@@ -72,7 +72,7 @@ struct coredump_params {
 struct linux_binfmt {
        struct list_head lh;
        struct module *module;
-       int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
+       int (*load_binary)(struct linux_binprm *);
        int (*load_shlib)(struct file *);
        int (*core_dump)(struct coredump_params *cprm);
        unsigned long min_coredump;     /* minimal dump size */