From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkBlN-0003AU-It for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:20:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkBlM-00080I-9D for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:20:21 -0400 Date: Wed, 5 Jun 2013 13:20:14 +0200 From: Stefan Hajnoczi Message-ID: <20130605112014.GD30326@stefanha-thinkpad.muc.redhat.com> References: <1370323097-11179-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370323097-11179-1-git-send-email-jasowang@redhat.com> Subject: Re: [Qemu-devel] [PATCH V2] net: tap: fix NULL dereference when passing invalid parameters to tap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, qemu-stable@nongnu.org, Stefan Hajnoczi , stefanha@redhat.com, Paolo Bonzini , Laszlo Ersek On Tue, Jun 04, 2013 at 01:18:17PM +0800, Jason Wang wrote: > This patch forbid the following invalid parameters to tap: > > 1) fd and vhostfds were specified but vhostfd were not specified > 2) vhostfds were specified but fds were not specified > 3) fds and vhostfd were specified > > For 1 and 2, net_init_tap_one() will still pass NULL as vhostfdname to > monitor_handle_fd_param(), which may crash the qemu. > > Also remove the unnecessary has_fd check. > > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: Laszlo Ersek > Cc: qemu-stable@nongnu.org > Signed-off-by: Jason Wang > > --- > Changes from v1: > - check vhostfds for has_helper and all other cases > - remove the unnecessary check for has_fd when fds were specified > --- > net/tap.c | 18 ++++++++++++------ > 1 files changed, 12 insertions(+), 6 deletions(-) Thanks, applied to my net tree: https://github.com/stefanha/qemu/commits/net Stefan