From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by h25xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1L6PUC-0007uA-GV for user-mode-linux-devel@lists.sourceforge.net; Sat, 29 Nov 2008 13:03:48 +0000 Received: from wa-out-1112.google.com ([209.85.146.180]) by 29vjzd1.ch3.sourceforge.com with esmtp (Exim 4.69) id 1L6PU8-0002yQ-5x for user-mode-linux-devel@lists.sourceforge.net; Sat, 29 Nov 2008 13:03:48 +0000 Received: by wa-out-1112.google.com with SMTP id m34so862976wag.10 for ; Sat, 29 Nov 2008 05:03:42 -0800 (PST) Message-ID: <2375c9f90811290503s1b4cb9aelaecccc680c6e37d0@mail.gmail.com> Date: Sat, 29 Nov 2008 13:03:42 +0000 From: "=?UTF-8?Q?Am=C3=A9rico_Wang?=" In-Reply-To: <20081129100830.GA24128@balbir.in.ibm.com> MIME-Version: 1.0 Content-Disposition: inline References: <20081129100830.GA24128@balbir.in.ibm.com> Subject: Re: [uml-devel] [PATCH][UML] Boot broken due to buffer overrun List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: balbir@linux.vnet.ibm.com, jdike@addtoit.com, linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net On Sat, Nov 29, 2008 at 10:08 AM, Balbir Singh wrote: > > 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. > > Reported-by: Vikas K Managutte > Reported-by: Sarvesh Kumar Lal Das > Signed-off-by: Balbir Singh > --- > > arch/um/drivers/mconsole_kern.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -puN arch/um/drivers/mconsole_kern.c~fix-uml-buggy-socket-creation arch/um/drivers/mconsole_kern.c > --- linux-2.6.28-rc6/arch/um/drivers/mconsole_kern.c~fix-uml-buggy-socket-creation 2008-11-29 15:29:04.000000000 +0530 > +++ linux-2.6.28-rc6-balbir/arch/um/drivers/mconsole_kern.c 2008-11-29 15:32:23.000000000 +0530 > @@ -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]; > Aha, good spot! Please also correct the length of mconsole_socket_name. Anyway, Reviewed-by: WANG Cong ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel