]> git.baikalelectronics.ru Git - kernel.git/commit
alpha: binfmt_aout fix
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>
Thu, 30 Apr 2009 22:08:49 +0000 (15:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 2 May 2009 22:36:10 +0000 (15:36 -0700)
commit3a05878074996a740bc2abcf2bba4582e893099b
treeda212b7ae1b5a2a50a4314b3a75df5763623295e
parentab9ec9269e6639f581912bbbdf4cef688a92416a
alpha: binfmt_aout fix

This fixes the problem introduced by commit d2e3d901b9 (get rid of
special-casing the /sbin/loader on alpha): osf/1 ecoff binary segfaults
when binfmt_aout built as module.  That happens because aout binary
handler gets on the top of the binfmt list due to late registration, and
kernel attempts to execute the binary without preparatory work that must
be done by binfmt_loader.

Fixed by changing the registration order of the default binfmt handlers
using list_add_tail() and introducing insert_binfmt() function which
places new handler on the top of the binfmt list.  This might be generally
useful for installing arch-specific frontends for default handlers or just
for overriding them.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Richard Henderson <rth@twiddle.net
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/alpha/kernel/Makefile
arch/alpha/kernel/binfmt_loader.c
fs/exec.c
include/linux/binfmts.h