]> www.infradead.org Git - users/jedix/linux-maple.git/commit
exec: do not call request_module() twice from search_binary_handler()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 26 Jul 2011 23:08:41 +0000 (16:08 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 10 Oct 2011 22:24:45 +0000 (15:24 -0700)
commitf3bd75fc933ee17e432fbd25e625cc3f93d1602e
treefd78c606a6742113462f97490bb9cd5e7c2bc758
parent3bd3f42d6421f19922280a4cbeb4938969944add
exec: do not call request_module() twice from search_binary_handler()

Currently, search_binary_handler() tries to load binary loader module
using request_module() if a loader for the requested program is not yet
loaded.  But second attempt of request_module() does not affect the result
of search_binary_handler().

If request_module() triggered recursion, calling request_module() twice
causes 2 to the power of MAX_KMOD_CONCURRENT (= 50) repetitions.  It is
not an infinite loop but is sufficient for users to consider as a hang up.

Therefore, this patch changes not to call request_module() twice, making 1
to the power of MAX_KMOD_CONCURRENT repetitions in case of recursion.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: Richard Weinberger <richard@nod.at>
Tested-by: 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>
fs/exec.c