diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-20 23:00:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-20 23:00:43 -0500 |
commit | 4c9a44aebeaef35570a67aed17b72a2cf8d0b219 (patch) | |
tree | abb874fe7f50671627b282f6c7fb58db5e75a2e3 /fs/exec.c | |
parent | 1f0377ff088ed2971c57debc9b0c3b846ec431fd (diff) | |
parent | cfde819088422503b5c69e03ab7bb90f87121d4d (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge the rest of Andrew's patches for -rc1:
"A bunch of fixes and misc missed-out-on things.
That'll do for -rc1. I still have a batch of IPC patches which still
have a possible bug report which I'm chasing down."
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (25 commits)
keys: use keyring_alloc() to create module signing keyring
keys: fix unreachable code
sendfile: allows bypassing of notifier events
SGI-XP: handle non-fatal traps
fat: fix incorrect function comment
Documentation: ABI: remove testing/sysfs-devices-node
proc: fix inconsistent lock state
linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors
memcg: don't register hotcpu notifier from ->css_alloc()
checkpatch: warn on uapi #includes that #include <uapi/...
revert "rtc: recycle id when unloading a rtc driver"
mm: clean up transparent hugepage sysfs error messages
hfsplus: add error message for the case of failure of sync fs in delayed_sync_fs() method
hfsplus: rework processing of hfs_btree_write() returned error
hfsplus: rework processing errors in hfsplus_free_extents()
hfsplus: avoid crash on failed block map free
kcmp: include linux/ptrace.h
drivers/rtc/rtc-imxdi.c: must include <linux/spinlock.h>
mm: cma: WARN if freed memory is still in use
exec: do not leave bprm->interp on stack
...
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1175,9 +1175,24 @@ void free_bprm(struct linux_binprm *bprm) | |||
1175 | mutex_unlock(¤t->signal->cred_guard_mutex); | 1175 | mutex_unlock(¤t->signal->cred_guard_mutex); |
1176 | abort_creds(bprm->cred); | 1176 | abort_creds(bprm->cred); |
1177 | } | 1177 | } |
1178 | /* If a binfmt changed the interp, free it. */ | ||
1179 | if (bprm->interp != bprm->filename) | ||
1180 | kfree(bprm->interp); | ||
1178 | kfree(bprm); | 1181 | kfree(bprm); |
1179 | } | 1182 | } |
1180 | 1183 | ||
1184 | int bprm_change_interp(char *interp, struct linux_binprm *bprm) | ||
1185 | { | ||
1186 | /* If a binfmt changed the interp, free it first. */ | ||
1187 | if (bprm->interp != bprm->filename) | ||
1188 | kfree(bprm->interp); | ||
1189 | bprm->interp = kstrdup(interp, GFP_KERNEL); | ||
1190 | if (!bprm->interp) | ||
1191 | return -ENOMEM; | ||
1192 | return 0; | ||
1193 | } | ||
1194 | EXPORT_SYMBOL(bprm_change_interp); | ||
1195 | |||
1181 | /* | 1196 | /* |
1182 | * install the new credentials for this executable | 1197 | * install the new credentials for this executable |
1183 | */ | 1198 | */ |