From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 5 19:25:50 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8710F1065670; Mon, 5 Mar 2012 19:25:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5C39D8FC14; Mon, 5 Mar 2012 19:25:50 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 11DA046B2D; Mon, 5 Mar 2012 14:25:50 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5E9F1B924; Mon, 5 Mar 2012 14:25:49 -0500 (EST) From: John Baldwin To: rank1seeker@gmail.com Date: Mon, 5 Mar 2012 14:06:12 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <20120302.151703.536.2@DOMY-PC> <201203051244.44681.jhb@freebsd.org> <20120305.181803.677.1@DOMY-PC> In-Reply-To: <20120305.181803.677.1@DOMY-PC> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1250" Content-Transfer-Encoding: 7bit Message-Id: <201203051406.12776.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 Mar 2012 14:25:49 -0500 (EST) Cc: Roman Divacky , hackers@freebsd.org, Andriy Gapon Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2012 19:25:50 -0000 On Monday, March 05, 2012 1:18:03 pm rank1seeker@gmail.com wrote: > ----- Original Message ----- > From: John Baldwin > To: rank1seeker@gmail.com > Cc: hackers@freebsd.org, "Roman Divacky" , "Andriy Gapon" > Date: Mon, 5 Mar 2012 12:44:44 -0500 > Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) > > > On Saturday, March 03, 2012 3:59:19 am rank1seeker@gmail.com wrote: > > > Using: MD5 (boot2_test.patch) = c2d6d2c9806df5915419987f200c05af > > > > > > Still fails to build. > > > > > > /usr/src/sys/boot/i386/boot2/boot2.c: In function 'main': > > > /usr/src/sys/boot/i386/boot2/boot2.c:282: error: expected ':' before ')' token > > > > My test build didn't actually build all of boot2. This should be fixed now. > > > > -- > > John Baldwin > > > Using: MD5 (boot2_test.patch) = b06e290859041cefc8ab38df37d06a36 > > Built and installed ... > Checking 2 times in a row ... > BINGO! It works! > > Excellent job John! > ;) > > So, what was an issue? The problem is that in your case when you used a custom loader string, kname was set to point to 'cmd', but 'cmd' is set to an empty string (to avoid re-parsing it) after the initial parse is done. This caused kname to point to an empty string. Even worse, if a user entered some unparseable text, with kname pointing at 'cmd', kname could effectively be overwritten with garbage. -- John Baldwin