From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9h9v-0001xa-8p for qemu-devel@nongnu.org; Thu, 28 May 2009 11:04:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9h9q-0001qr-Bk for qemu-devel@nongnu.org; Thu, 28 May 2009 11:04:42 -0400 Received: from [199.232.76.173] (port=44259 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9h9q-0001qa-3X for qemu-devel@nongnu.org; Thu, 28 May 2009 11:04:38 -0400 Received: from mx20.gnu.org ([199.232.41.8]:39966) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M9h9p-0004e1-Fr for qemu-devel@nongnu.org; Thu, 28 May 2009 11:04:37 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9h9o-0004PB-QP for qemu-devel@nongnu.org; Thu, 28 May 2009 11:04:37 -0400 Subject: Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users From: Mark McLoughlin In-Reply-To: <20090508103417.6080.2193.stgit@mchn012c.ww002.siemens.net> References: <20090508103416.6080.44298.stgit@mchn012c.ww002.siemens.net> <20090508103417.6080.2193.stgit@mchn012c.ww002.siemens.net> Content-Type: text/plain Date: Thu, 28 May 2009 16:04:32 +0100 Message-Id: <1243523072.4046.185.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 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 Okay, I think we should revert Kevin's fix from master and replace it with this one. > @@ -1944,12 +1944,12 @@ int net_client_init(const char *device, const char *p) > #elif defined (_AIX) > #else > if (!strcmp(device, "tap")) { > - char ifname[64]; > + char ifname[64], chkbuf[64]; > char setup_script[1024], down_script[1024]; > int fd; > vlan->nb_host_devs++; > if (get_param_value(buf, sizeof(buf), "fd", p) > 0) { > - if (check_params(fd_params, p) < 0) { > + if (check_params(chkbuf, sizeof(chkbuf), fd_params, p) < 0) { > fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n", > buf, p); Should use chkbuf in the fprintf. Following up with a patch series. Cheers, Mark.