From: Richard Weinberger <richard@nod.at>
To: viro@zeniv.linux.org.uk
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Richard Weinberger <richard@nod.at>
Subject: [PATCH][Resend v2] Fix infinite loop in search_binary_handler()
Date: Mon, 4 Jul 2011 13:30:03 +0200 [thread overview]
Message-ID: <1309779003-8668-1-git-send-email-richard@nod.at> (raw)
When search_binary_handler() is called to find a handler
for /sbin/modprobe it will end up in an infinite loop because
it executes request_module() to load a binfmt module with
/sbin/modprobe...
Running a x86_64 kernel without ia32 emulation and a x86 user land
triggers this issue.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
fs/exec.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index 97e0d52..7271b22 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1411,7 +1411,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
printable(bprm->buf[2]) &&
printable(bprm->buf[3]))
break; /* -ENOEXEC */
- request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2]));
+
+ /* Avoid an infinite loop */
+ if (strcmp(modprobe_path, bprm->filename))
+ request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2]));
#endif
}
}
--
1.7.5.4
next reply other threads:[~2011-07-04 11:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 11:30 Richard Weinberger [this message]
2011-07-04 11:51 ` [PATCH][Resend v2] Fix infinite loop in search_binary_handler() Tetsuo Handa
2011-07-04 11:57 ` Richard Weinberger
2011-07-04 12:10 ` Tetsuo Handa
2011-07-04 12:20 ` Richard Weinberger
2011-07-04 14:42 ` Tetsuo Handa
2011-07-04 14:59 ` Richard Weinberger
2011-07-04 15:07 ` Richard Weinberger
2011-07-04 22:03 ` Tetsuo Handa
2011-07-04 22:17 ` Richard Weinberger
2011-07-05 1:24 ` Tetsuo Handa
2011-07-05 9:55 ` Richard Weinberger
2011-07-05 12:02 ` Tetsuo Handa
2011-07-05 12:21 ` Richard Weinberger
2011-07-06 11:28 ` Tetsuo Handa
2011-07-06 11:36 ` Richard Weinberger
2011-07-06 20:21 ` Andrew Morton
2011-07-07 4:04 ` Tetsuo Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309779003-8668-1-git-send-email-richard@nod.at \
--to=richard@nod.at \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).