提交 3c456bfc 编写于 作者: A Al Viro

get rid of pt_regs argument of search_binary_handler()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 835ab32d
...@@ -37,7 +37,7 @@ static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs) ...@@ -37,7 +37,7 @@ static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs)
retval = prepare_binprm(bprm); retval = prepare_binprm(bprm);
if (retval < 0) if (retval < 0)
return retval; return retval;
return search_binary_handler(bprm,regs); return search_binary_handler(bprm);
} }
static struct linux_binfmt loader_format = { static struct linux_binfmt loader_format = {
......
...@@ -90,7 +90,7 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) ...@@ -90,7 +90,7 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
if (retval < 0) if (retval < 0)
return retval; return retval;
return search_binary_handler(bprm, regs); return search_binary_handler(bprm);
} }
static struct linux_binfmt em86_format = { static struct linux_binfmt em86_format = {
......
...@@ -199,7 +199,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) ...@@ -199,7 +199,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
bprm->recursion_depth++; bprm->recursion_depth++;
retval = search_binary_handler (bprm, regs); retval = search_binary_handler(bprm);
if (retval < 0) if (retval < 0)
goto _error; goto _error;
......
...@@ -95,7 +95,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) ...@@ -95,7 +95,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
retval = prepare_binprm(bprm); retval = prepare_binprm(bprm);
if (retval < 0) if (retval < 0)
return retval; return retval;
return search_binary_handler(bprm,regs); return search_binary_handler(bprm);
} }
static struct linux_binfmt script_format = { static struct linux_binfmt script_format = {
......
...@@ -1349,7 +1349,7 @@ EXPORT_SYMBOL(remove_arg_zero); ...@@ -1349,7 +1349,7 @@ EXPORT_SYMBOL(remove_arg_zero);
/* /*
* cycle the list of binary formats handler, until one recognizes the image * cycle the list of binary formats handler, until one recognizes the image
*/ */
int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) int search_binary_handler(struct linux_binprm *bprm)
{ {
unsigned int depth = bprm->recursion_depth; unsigned int depth = bprm->recursion_depth;
int try,retval; int try,retval;
...@@ -1380,7 +1380,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) ...@@ -1380,7 +1380,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
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, regs); retval = fn(bprm, current_pt_regs());
/* /*
* 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
...@@ -1447,7 +1447,6 @@ static int do_execve_common(const char *filename, ...@@ -1447,7 +1447,6 @@ static int do_execve_common(const char *filename,
bool clear_in_exec; bool clear_in_exec;
int retval; int retval;
const struct cred *cred = current_cred(); const struct cred *cred = current_cred();
struct pt_regs *regs = current_pt_regs();
/* /*
* We move the actual failure in case of RLIMIT_NPROC excess from * We move the actual failure in case of RLIMIT_NPROC excess from
...@@ -1524,7 +1523,7 @@ static int do_execve_common(const char *filename, ...@@ -1524,7 +1523,7 @@ static int do_execve_common(const char *filename,
if (retval < 0) if (retval < 0)
goto out; goto out;
retval = search_binary_handler(bprm,regs); retval = search_binary_handler(bprm);
if (retval < 0) if (retval < 0)
goto out; goto out;
......
...@@ -95,7 +95,7 @@ extern void unregister_binfmt(struct linux_binfmt *); ...@@ -95,7 +95,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
extern int prepare_binprm(struct linux_binprm *); extern int prepare_binprm(struct linux_binprm *);
extern int __must_check remove_arg_zero(struct linux_binprm *); extern int __must_check remove_arg_zero(struct linux_binprm *);
extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); extern int search_binary_handler(struct linux_binprm *);
extern int flush_old_exec(struct linux_binprm * bprm); extern int flush_old_exec(struct linux_binprm * bprm);
extern void setup_new_exec(struct linux_binprm * bprm); extern void setup_new_exec(struct linux_binprm * bprm);
extern void would_dump(struct linux_binprm *, struct file *); extern void would_dump(struct linux_binprm *, struct file *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册