Commit 71613c3b authored by Al Viro's avatar Al Viro

get rid of pt_regs argument of ->load_binary()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3c456bfc
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <linux/binfmts.h> #include <linux/binfmts.h>
#include <linux/a.out.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; struct exec *eh = (struct exec *)bprm->buf;
unsigned long loader; unsigned long loader;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#undef WARN_OLD #undef WARN_OLD
#undef CORE_DUMP /* definitely broken */ #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 *); static int load_aout_library(struct file *);
#ifdef CORE_DUMP #ifdef CORE_DUMP
...@@ -260,9 +260,10 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm) ...@@ -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 * These are the functions used to load a.out style executables and shared
* libraries. There is no binary dependent code anywhere else. * 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; unsigned long error, fd_offset, rlim;
struct pt_regs *regs = current_pt_regs();
struct exec ex; struct exec ex;
int retval; int retval;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/a.out-core.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*); static int load_aout_library(struct file*);
#ifdef CONFIG_COREDUMP #ifdef CONFIG_COREDUMP
...@@ -201,8 +201,9 @@ static unsigned long __user *create_aout_tables(char __user *p, struct linux_bin ...@@ -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. * 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; struct exec ex;
unsigned long error; unsigned long error;
unsigned long fd_offset; unsigned long fd_offset;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define user_siginfo_t siginfo_t #define user_siginfo_t siginfo_t
#endif #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 int load_elf_library(struct file *);
static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *, static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *,
int, int, unsigned long); int, int, unsigned long);
...@@ -558,7 +558,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top) ...@@ -558,7 +558,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top)
#endif #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 */ struct file *interpreter = NULL; /* to shut gcc up */
unsigned long load_addr = 0, load_bias = 0; 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) ...@@ -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; unsigned long reloc_func_desc __maybe_unused = 0;
int executable_stack = EXSTACK_DEFAULT; int executable_stack = EXSTACK_DEFAULT;
unsigned long def_flags = 0; unsigned long def_flags = 0;
struct pt_regs *regs = current_pt_regs();
struct { struct {
struct elfhdr elf_ex; struct elfhdr elf_ex;
struct elfhdr interp_elf_ex; struct elfhdr interp_elf_ex;
......
...@@ -56,7 +56,7 @@ typedef char *elf_caddr_t; ...@@ -56,7 +56,7 @@ typedef char *elf_caddr_t;
MODULE_LICENSE("GPL"); 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_fetch_phdrs(struct elf_fdpic_params *, struct file *);
static int elf_fdpic_map_file(struct elf_fdpic_params *, struct file *, static int elf_fdpic_map_file(struct elf_fdpic_params *, struct file *,
struct mm_struct *, const char *); struct mm_struct *, const char *);
...@@ -164,10 +164,10 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, ...@@ -164,10 +164,10 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params,
/* /*
* load an fdpic binary into various bits of memory * load an fdpic binary into various bits of memory
*/ */
static int load_elf_fdpic_binary(struct linux_binprm *bprm, static int load_elf_fdpic_binary(struct linux_binprm *bprm)
struct pt_regs *regs)
{ {
struct elf_fdpic_params exec_params, interp_params; struct elf_fdpic_params exec_params, interp_params;
struct pt_regs *regs = current_pt_regs();
struct elf_phdr *phdr; struct elf_phdr *phdr;
unsigned long stack_size, entryaddr; unsigned long stack_size, entryaddr;
#ifdef ELF_FDPIC_PLAT_INIT #ifdef ELF_FDPIC_PLAT_INIT
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define EM86_INTERP "/usr/bin/em86" #define EM86_INTERP "/usr/bin/em86"
#define EM86_I_NAME "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; char *interp, *i_name, *i_arg;
struct file * file; struct file * file;
......
...@@ -88,7 +88,7 @@ struct lib_info { ...@@ -88,7 +88,7 @@ struct lib_info {
static int load_flat_shared_library(int id, struct lib_info *p); static int load_flat_shared_library(int id, struct lib_info *p);
#endif #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 int flat_core_dump(struct coredump_params *cprm);
static struct linux_binfmt flat_format = { static struct linux_binfmt flat_format = {
...@@ -858,9 +858,10 @@ static int load_flat_shared_library(int id, struct lib_info *libs) ...@@ -858,9 +858,10 @@ static int load_flat_shared_library(int id, struct lib_info *libs)
* libraries. There is no binary dependent code anywhere else. * 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 lib_info libinfo;
struct pt_regs *regs = current_pt_regs();
unsigned long p = bprm->p; unsigned long p = bprm->p;
unsigned long stack_len; unsigned long stack_len;
unsigned long start_addr; unsigned long start_addr;
......
...@@ -104,7 +104,7 @@ static Node *check_file(struct linux_binprm *bprm) ...@@ -104,7 +104,7 @@ static Node *check_file(struct linux_binprm *bprm)
/* /*
* the loader itself * 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; Node *fmt;
struct file * interp_file = NULL; struct file * interp_file = NULL;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/fs.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; const char *i_arg, *i_name;
char *cp; char *cp;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <linux/elf.h> #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 *); static int load_som_library(struct file *);
/* /*
...@@ -180,13 +180,14 @@ static int map_som_binary(struct file *file, ...@@ -180,13 +180,14 @@ static int map_som_binary(struct file *file,
*/ */
static int static int
load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs) load_som_binary(struct linux_binprm * bprm)
{ {
int retval; int retval;
unsigned int size; unsigned int size;
unsigned long som_entry; unsigned long som_entry;
struct som_hdr *som_ex; struct som_hdr *som_ex;
struct som_exec_auxhdr *hpuxhdr; struct som_exec_auxhdr *hpuxhdr;
struct pt_regs *regs = current_pt_regs();
/* Get the exec-header */ /* Get the exec-header */
som_ex = (struct som_hdr *) bprm->buf; som_ex = (struct som_hdr *) bprm->buf;
......
...@@ -1374,13 +1374,13 @@ int search_binary_handler(struct linux_binprm *bprm) ...@@ -1374,13 +1374,13 @@ int search_binary_handler(struct linux_binprm *bprm)
for (try=0; try<2; try++) { for (try=0; try<2; try++) {
read_lock(&binfmt_lock); read_lock(&binfmt_lock);
list_for_each_entry(fmt, &formats, lh) { 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) if (!fn)
continue; continue;
if (!try_module_get(fmt->module)) if (!try_module_get(fmt->module))
continue; continue;
read_unlock(&binfmt_lock); read_unlock(&binfmt_lock);
retval = fn(bprm, current_pt_regs()); retval = fn(bprm);
/* /*
* Restore the depth counter to its starting value * Restore the depth counter to its starting value
* in this call, so we don't have to rely on every * in this call, so we don't have to rely on every
......
...@@ -72,7 +72,7 @@ struct coredump_params { ...@@ -72,7 +72,7 @@ struct coredump_params {
struct linux_binfmt { struct linux_binfmt {
struct list_head lh; struct list_head lh;
struct module *module; 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 (*load_shlib)(struct file *);
int (*core_dump)(struct coredump_params *cprm); int (*core_dump)(struct coredump_params *cprm);
unsigned long min_coredump; /* minimal dump size */ unsigned long min_coredump; /* minimal dump size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment