From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41231 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ4zm-0000OW-M6 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 08:57:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ4zh-0008CE-Gb for qemu-devel@nongnu.org; Thu, 18 Nov 2010 08:57:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ4zh-0008C1-78 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 08:57:45 -0500 Message-ID: <4CE530D4.9030602@redhat.com> Date: Thu, 18 Nov 2010 14:57:40 +0100 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC][PATCH v4 02/18] virtagent: base definitions for host/guest RPC server References: <1289923320-5638-1-git-send-email-mdroth@linux.vnet.ibm.com> <1289923320-5638-3-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1289923320-5638-3-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, agl@linux.vnet.ibm.com, qemu-devel@nongnu.org, abeekhof@redhat.com On 11/16/10 17:01, Michael Roth wrote: > +#include > +#include "qemu_socket.h" > +#include "virtagent-daemon.h" > +#include "virtagent-common.h" > +#include "virtagent.h" > + > +static bool va_enable_syslog = false; /* enable syslog'ing of RPCs */ > + > +#define SLOG(msg, ...) do { \ > + char msg_buf[1024]; \ > + if (!va_enable_syslog) { \ > + break; \ > + } \ > + sprintf(msg_buf, msg, ## __VA_ARGS__); \ > + syslog(LOG_INFO, "virtagent, %s", msg_buf); \ > +} while(0) You have a potential buffer overflow here, s/sprintf/snprintf/ > +#include "virtproxy.h" > + > +#define GUEST_AGENT_SERVICE_ID "virtagent" > +#define GUEST_AGENT_PATH "/tmp/virtagent-guest.sock" > +#define HOST_AGENT_SERVICE_ID "virtagent-host" > +#define HOST_AGENT_PATH "/tmp/virtagent-host.sock" > +#define VA_GETFILE_MAX 1 << 30 > +#define VA_FILEBUF_LEN 16384 > + > +int va_server_init(VPDriver *vp_drv, bool is_host); More stuff which I think should go into a config file. Jes