Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761701AbYLKTor (ORCPT ); Thu, 11 Dec 2008 14:44:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757914AbYLKTTa (ORCPT ); Thu, 11 Dec 2008 14:19:30 -0500 Received: from kroah.org ([198.145.64.141]:56699 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756525AbYLKTT1 (ORCPT ); Thu, 11 Dec 2008 14:19:27 -0500 Date: Thu, 11 Dec 2008 11:16:35 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Balbir Singh , Jeff Dike Subject: [patch 74/83] uml: boot broken due to buffer overrun Message-ID: <20081211191635.GV5894@kroah.com> References: <20081211190201.612240183@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="uml-boot-broken-due-to-buffer-overrun.patch" In-Reply-To: <20081211191014.GA5759@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1834 Lines: 53 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Balbir Singh commit 361371201b60ffd686a694c848c1d5ad6061725f upstream. 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 Reported-by: Sarvesh Kumar Lal Das Signed-off-by: Balbir Singh Reviewed-by: Pekka Enberg Reviewed-by: WANG Cong Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/um/drivers/mconsole_kern.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include #include #include @@ -785,7 +787,7 @@ static int __init mconsole_init(void) /* long to avoid size mismatch warnings from gcc */ long sock; int err; - char file[256]; + char file[UNIX_PATH_MAX]; if (umid_file_name("mconsole", file, sizeof(file))) return -1; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/