From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6Lik-00032X-6n for qemu-devel@nongnu.org; Tue, 19 May 2009 05:34:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6Lig-0002yg-3Q for qemu-devel@nongnu.org; Tue, 19 May 2009 05:34:49 -0400 Received: from [199.232.76.173] (port=40697 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6Lif-0002yS-8T for qemu-devel@nongnu.org; Tue, 19 May 2009 05:34:45 -0400 Received: from gecko.sbs.de ([194.138.37.40]:19271) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6Lie-0003st-Lf for qemu-devel@nongnu.org; Tue, 19 May 2009 05:34:45 -0400 Message-ID: <4A127D2D.7050802@siemens.com> Date: Tue, 19 May 2009 11:34:37 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users References: <20090508103416.6080.44298.stgit@mchn012c.ww002.siemens.net> <20090508103417.6080.2193.stgit@mchn012c.ww002.siemens.net> <1242719865.16653.2.camel@blaa> In-Reply-To: <1242719865.16653.2.camel@blaa> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org 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? :-> Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux