dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/include
Pavel Emelyanov 3a2e7f47d7 binfmt_misc.c: avoid potential kernel stack overflow
This can be triggered with root help only, but...

Register the ":text:E::txt::/root/cat.txt:' rule in binfmt_misc (by root) and
try launching the cat.txt file (by anyone) :) The result is - the endless
recursion in the load_misc_binary -> open_exec -> load_misc_binary chain and
stack overflow.

There's a similar problem with binfmt_script, and there's a sh_bang memner on
linux_binprm structure to handle this, but simply raising this in binfmt_misc
may break some setups when the interpreter of some misc binaries is a script.

So the proposal is to turn sh_bang into a bit, add a new one (the misc_bang)
and raise it in load_misc_binary.  After this, even if we set up the misc ->
script -> misc loop for binfmts one of them will step on its own bang and
exit.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:04 -07:00
..
acpi
asm-alpha
asm-arm
asm-avr32
asm-blackfin
asm-cris
asm-frv
asm-generic gpiochip_reserve() 2008-04-28 08:58:34 -07:00
asm-h8300
asm-ia64 fix ia64 local_irq_save() et.al. 2008-04-28 10:03:31 -07:00
asm-m32r
asm-m68k
asm-m68knommu
asm-mips Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2008-04-28 10:51:43 -07:00
asm-mn10300
asm-parisc
asm-powerpc proper __do_softirq() prototype 2008-04-29 08:06:02 -07:00
asm-ppc
asm-s390
asm-sh
asm-sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-28 09:45:57 -07:00
asm-sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-28 09:45:57 -07:00
asm-um
asm-v850
asm-x86 proper extern for late_time_init 2008-04-29 08:06:03 -07:00
asm-xtensa
crypto
keys
linux binfmt_misc.c: avoid potential kernel stack overflow 2008-04-29 08:06:04 -07:00
math-emu
media
mtd
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-28 09:44:11 -07:00
pcmcia
rdma
rxrpc
scsi
sound
video fbdev: platforming hecubafb and n411 2008-04-28 08:58:41 -07:00
xen
Kbuild