diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-05 12:16:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-05 12:16:18 -0500 |
commit | a65981109f294ba7e64b33ad3b4575a4636fce66 (patch) | |
tree | 1061a49f11544e18775630938a8bc53920fa0421 /fs/binfmt_script.c | |
parent | 3fed6ae4b027f9c93be18520f87bd06bdffd196b (diff) | |
parent | b685a7350ae76bc0f388e24b36d06a63776c68ee (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
- procfs updates
- various misc bits
- lib/ updates
- epoll updates
- autofs
- fatfs
- a few more MM bits
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (58 commits)
mm/page_io.c: fix polled swap page in
checkpatch: add Co-developed-by to signature tags
docs: fix Co-Developed-by docs
drivers/base/platform.c: kmemleak ignore a known leak
fs: don't open code lru_to_page()
fs/: remove caller signal_pending branch predictions
mm/: remove caller signal_pending branch predictions
arch/arc/mm/fault.c: remove caller signal_pending_branch predictions
kernel/sched/: remove caller signal_pending branch predictions
kernel/locking/mutex.c: remove caller signal_pending branch predictions
mm: select HAVE_MOVE_PMD on x86 for faster mremap
mm: speed up mremap by 20x on large regions
mm: treewide: remove unused address argument from pte_alloc functions
initramfs: cleanup incomplete rootfs
scripts/gdb: fix lx-version string output
kernel/kcov.c: mark write_comp_data() as notrace
kernel/sysctl: add panic_print into sysctl
panic: add options to print system info when panic happens
bfs: extra sanity checking and static inode bitmap
exec: separate MM_ANONPAGES and RLIMIT_STACK accounting
...
Diffstat (limited to 'fs/binfmt_script.c')
-rw-r--r-- | fs/binfmt_script.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index 7cde3f46ad26..d0078cbb718b 100644 --- a/fs/binfmt_script.c +++ b/fs/binfmt_script.c | |||
@@ -42,10 +42,14 @@ static int load_script(struct linux_binprm *bprm) | |||
42 | fput(bprm->file); | 42 | fput(bprm->file); |
43 | bprm->file = NULL; | 43 | bprm->file = NULL; |
44 | 44 | ||
45 | bprm->buf[BINPRM_BUF_SIZE - 1] = '\0'; | 45 | for (cp = bprm->buf+2;; cp++) { |
46 | if ((cp = strchr(bprm->buf, '\n')) == NULL) | 46 | if (cp >= bprm->buf + BINPRM_BUF_SIZE) |
47 | cp = bprm->buf+BINPRM_BUF_SIZE-1; | 47 | return -ENOEXEC; |
48 | if (!*cp || (*cp == '\n')) | ||
49 | break; | ||
50 | } | ||
48 | *cp = '\0'; | 51 | *cp = '\0'; |
52 | |||
49 | while (cp > bprm->buf) { | 53 | while (cp > bprm->buf) { |
50 | cp--; | 54 | cp--; |
51 | if ((*cp == ' ') || (*cp == '\t')) | 55 | if ((*cp == ' ') || (*cp == '\t')) |