uml: boot broken due to buffer overrun
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Tue, 9 Dec 2008 21:14:07 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2008 16:01:52 +0000 (08:01 -0800)
commit361371201b60ffd686a694c848c1d5ad6061725f
tree925f3fa0e62a5fc64840824dfd9a9aad36cb1076
parent69fc208be5b7eb18d22d1eca185b201400fd5ffc
uml: boot broken due to buffer overrun

mconsole_init() passed 256 bytes as length in os_create_unix_socket, while
the sizeof UNIX_PATH_MAX is 108. This patch fixes that problem and avoids
a big overrun bug reported on UML bootup.

sockaddr_un.sun_path is UNIX_PATH_MAX long which causes the problem.
Reported-by: Vikas K Managutte <vikki.km@gmail.com>
Reported-by: Sarvesh Kumar Lal Das <skldas@gmail.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Reviewed-by: WANG Cong <wangcong@zeuux.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: <stable@kernel.org> [please check with Jeff]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/mconsole_kern.c