[PATCH] IA64,sparc: local DoS with corrupted ELFs
authorKirill Korotaev <dev@openvz.org>
Thu, 7 Sep 2006 10:17:04 +0000 (14:17 +0400)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Sep 2006 15:40:46 +0000 (08:40 -0700)
commit3a459756810912d2c2bf188cef566af255936b4d
tree1b52d90a2412811ebf5078b4f55112864e1890df
parent10387e5eb45c6e48d67102b88229f5bc6037461c
[PATCH] IA64,sparc: local DoS with corrupted ELFs

This prevents cross-region mappings on IA64 and SPARC which could lead
to system crash.  They were correctly trapped for normal mmap() calls,
but not for the kernel internal calls generated by executable loading.

This code just moves the architecture-specific cross-region checks into
an arch-specific "arch_mmap_check()" macro, and defines that for the
architectures that needed it (ia64, sparc and sparc64).

Architectures that don't have any special requirements can just ignore
the new cross-region check, since the mmap() code will just notice on
its own when the macro isn't defined.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Acked-by: David Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[ Cleaned up to not affect architectures that don't need it ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ia64/kernel/sys_ia64.c
arch/sparc/kernel/sys_sparc.c
arch/sparc64/kernel/sys_sparc.c
include/asm-ia64/mman.h
include/asm-sparc/mman.h
include/asm-sparc64/mman.h
mm/mmap.c