Skip to content

Commit 3c456bf

Browse files
author
Al Viro
committed
get rid of pt_regs argument of search_binary_handler()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 835ab32 commit 3c456bf

6 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎arch/alpha/kernel/binfmt_loader.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs)
3737
retval = prepare_binprm(bprm);
3838
if (retval < 0)
3939
return retval;
40-
return search_binary_handler(bprm,regs);
40+
return search_binary_handler(bprm);
4141
}
4242

4343
static struct linux_binfmt loader_format = {

‎fs/binfmt_em86.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
9090
if (retval < 0)
9191
return retval;
9292

93-
return search_binary_handler(bprm, regs);
93+
return search_binary_handler(bprm);
9494
}
9595

9696
static struct linux_binfmt em86_format = {

‎fs/binfmt_misc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
199199

200200
bprm->recursion_depth++;
201201

202-
retval = search_binary_handler (bprm, regs);
202+
retval = search_binary_handler(bprm);
203203
if (retval < 0)
204204
goto _error;
205205

‎fs/binfmt_script.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
9595
retval = prepare_binprm(bprm);
9696
if (retval < 0)
9797
return retval;
98-
return search_binary_handler(bprm,regs);
98+
return search_binary_handler(bprm);
9999
}
100100

101101
static struct linux_binfmt script_format = {

‎fs/exec.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ EXPORT_SYMBOL(remove_arg_zero);
13491349
/*
13501350
* cycle the list of binary formats handler, until one recognizes the image
13511351
*/
1352-
int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1352+
int search_binary_handler(struct linux_binprm *bprm)
13531353
{
13541354
unsigned int depth = bprm->recursion_depth;
13551355
int try,retval;
@@ -1380,7 +1380,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
13801380
if (!try_module_get(fmt->module))
13811381
continue;
13821382
read_unlock(&binfmt_lock);
1383-
retval = fn(bprm, regs);
1383+
retval = fn(bprm, current_pt_regs());
13841384
/*
13851385
* Restore the depth counter to its starting value
13861386
* in this call, so we don't have to rely on every
@@ -1447,7 +1447,6 @@ static int do_execve_common(const char *filename,
14471447
bool clear_in_exec;
14481448
int retval;
14491449
const struct cred *cred = current_cred();
1450-
struct pt_regs *regs = current_pt_regs();
14511450

14521451
/*
14531452
* We move the actual failure in case of RLIMIT_NPROC excess from
@@ -1524,7 +1523,7 @@ static int do_execve_common(const char *filename,
15241523
if (retval < 0)
15251524
goto out;
15261525

1527-
retval = search_binary_handler(bprm,regs);
1526+
retval = search_binary_handler(bprm);
15281527
if (retval < 0)
15291528
goto out;
15301529

‎include/linux/binfmts.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
9595

9696
extern int prepare_binprm(struct linux_binprm *);
9797
extern int __must_check remove_arg_zero(struct linux_binprm *);
98-
extern int search_binary_handler(struct linux_binprm *, struct pt_regs *);
98+
extern int search_binary_handler(struct linux_binprm *);
9999
extern int flush_old_exec(struct linux_binprm * bprm);
100100
extern void setup_new_exec(struct linux_binprm * bprm);
101101
extern void would_dump(struct linux_binprm *, struct file *);

0 commit comments

Comments
 (0)