Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96993
b: refs/heads/master
c: 08a6fac
h: refs/heads/master
i:
  96991: bed64dd
v: v3
  • Loading branch information
Al Viro committed May 16, 2008
1 parent f17da0d commit 98ea9d5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f719558edf9c84bfbb1f7ad37e84c483282d09f
refs/heads/master: 08a6fac1c63233c87eec129938022f1a9a4d51f6
4 changes: 2 additions & 2 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ int compat_do_execve(char * filename,
/* execve success */
security_bprm_free(bprm);
acct_update_integrals(current);
kfree(bprm);
free_bprm(bprm);
return retval;
}

Expand All @@ -1424,7 +1424,7 @@ int compat_do_execve(char * filename,
}

out_kfree:
kfree(bprm);
free_bprm(bprm);

out_ret:
return retval;
Expand Down
12 changes: 8 additions & 4 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,12 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)

EXPORT_SYMBOL(search_binary_handler);

void free_bprm(struct linux_binprm *bprm)
{
free_arg_pages(bprm);
kfree(bprm);
}

/*
* sys_execve() executes a new program.
*/
Expand Down Expand Up @@ -1320,17 +1326,15 @@ int do_execve(char * filename,
retval = search_binary_handler(bprm,regs);
if (retval >= 0) {
/* execve success */
free_arg_pages(bprm);
security_bprm_free(bprm);
acct_update_integrals(current);
kfree(bprm);
free_bprm(bprm);
if (displaced)
put_files_struct(displaced);
return retval;
}

out:
free_arg_pages(bprm);
if (bprm->security)
security_bprm_free(bprm);

Expand All @@ -1344,7 +1348,7 @@ int do_execve(char * filename,
fput(bprm->file);
}
out_kfree:
kfree(bprm);
free_bprm(bprm);

out_files:
if (displaced)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/binfmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
extern void compute_creds(struct linux_binprm *binprm);
extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
extern int set_binfmt(struct linux_binfmt *new);
extern void free_bprm(struct linux_binprm *);

#endif /* __KERNEL__ */
#endif /* _LINUX_BINFMTS_H */

0 comments on commit 98ea9d5

Please sign in to comment.