[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1309779003-8668-1-git-send-email-richard@nod.at>
Date: Mon, 4 Jul 2011 13:30:03 +0200
From: Richard Weinberger <richard@....at>
To: viro@...iv.linux.org.uk
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Richard Weinberger <richard@....at>
Subject: [PATCH][Resend v2] Fix infinite loop in search_binary_handler()
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@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists