From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6M4f-0007HE-Nx for qemu-devel@nongnu.org; Tue, 19 May 2009 05:57:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6M4a-0007FE-MX for qemu-devel@nongnu.org; Tue, 19 May 2009 05:57:28 -0400 Received: from [199.232.76.173] (port=32926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6M4Z-0007F0-VK for qemu-devel@nongnu.org; Tue, 19 May 2009 05:57:24 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54715) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6M4Z-0006sh-D1 for qemu-devel@nongnu.org; Tue, 19 May 2009 05:57:23 -0400 Subject: Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users From: Mark McLoughlin In-Reply-To: <4A127D2D.7050802@siemens.com> References: <20090508103416.6080.44298.stgit@mchn012c.ww002.siemens.net> <20090508103417.6080.2193.stgit@mchn012c.ww002.siemens.net> <1242719865.16653.2.camel@blaa> <4A127D2D.7050802@siemens.com> Content-Type: text/plain Date: Tue, 19 May 2009 10:57:19 +0100 Message-Id: <1242727039.16653.6.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Tue, 2009-05-19 at 11:34 +0200, Jan Kiszka wrote: > Mark McLoughlin wrote: > > Hi Jan, > > > > On Fri, 2009-05-08 at 12:34 +0200, Jan Kiszka wrote: > >> OK, last try: ea053add70 broke -net socket, ffad4116b9 tried to fix it > >> but broke error reporting of invalid parameters. So this patch widely > >> reverts ffad4116b9 again and intead fixes those callers of check_params > >> that originally suffered from overwritten buffers by using separate > >> ones. > >> > >> Signed-off-by: Jan Kiszka > >> --- > >> > >> net.c | 23 ++++++++++++----------- > >> sysemu.h | 3 ++- > >> vl.c | 39 ++++++++++++++------------------------- > >> 3 files changed, 28 insertions(+), 37 deletions(-) > >> > >> diff --git a/net.c b/net.c > >> index 6a5c698..cf00c9c 100644 > >> --- a/net.c > >> +++ b/net.c > >> @@ -1826,7 +1826,7 @@ int net_client_init(const char *device, const char *p) > >> uint8_t *macaddr; > >> int idx = nic_get_free_idx(); > >> > >> - if (check_params(nic_params, p) < 0) { > >> + if (check_params(buf, sizeof(buf), nic_params, p) < 0) { > >> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n", > >> buf, p); > >> return -1; > > > > All callers used the scratch buffer to obtain the invalid parameter name > > for error messages. Now, e.g. I get: > > > > $> qemu-system-x86_64 -drive foo=bar > > qemu: unknown parameter '' in 'foo=bar' > > > > Works for me with that patch applied. Are you sure you ran the right > (==patched) instance of qemu-system-x86_64? :-> Apologies, I was confused - I thought this patch had already been applied and was causing the problem that it actually fixes :-) Cheers, Mark.