diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2011-07-26 19:08:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:44 -0400 |
commit | b4edf8bd06916645b57df23a720b17cae4051c43 (patch) | |
tree | d0b6a63dfb043822d28498eae9a89553765ce3fe /fs/exec.c | |
parent | 912193521b719fbfc2f16776febf5232fe8ba261 (diff) |
exec: do not retry load_binary method if CONFIG_MODULES=n
If CONFIG_MODULES=n, it makes no sense to retry the list of binary formats
handler because the list will not be modified by request_module().
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Richard Weinberger <richard@nod.at>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1430,9 +1430,9 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1430 | } | 1430 | } |
1431 | } | 1431 | } |
1432 | read_unlock(&binfmt_lock); | 1432 | read_unlock(&binfmt_lock); |
1433 | #ifdef CONFIG_MODULES | ||
1433 | if (retval != -ENOEXEC || bprm->mm == NULL) { | 1434 | if (retval != -ENOEXEC || bprm->mm == NULL) { |
1434 | break; | 1435 | break; |
1435 | #ifdef CONFIG_MODULES | ||
1436 | } else { | 1436 | } else { |
1437 | #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) | 1437 | #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) |
1438 | if (printable(bprm->buf[0]) && | 1438 | if (printable(bprm->buf[0]) && |
@@ -1443,8 +1443,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1443 | if (try) | 1443 | if (try) |
1444 | break; /* -ENOEXEC */ | 1444 | break; /* -ENOEXEC */ |
1445 | request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2])); | 1445 | request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2])); |
1446 | #endif | ||
1447 | } | 1446 | } |
1447 | #else | ||
1448 | break; | ||
1449 | #endif | ||
1448 | } | 1450 | } |
1449 | return retval; | 1451 | return retval; |
1450 | } | 1452 | } |