[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2] net: tap: fix NULL dereference when passing
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH V2] net: tap: fix NULL dereference when passing invalid parameters to tap |
Date: |
Wed, 5 Jun 2013 13:20:14 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 <address@hidden>
> Cc: Stefan Hajnoczi <address@hidden>
> Cc: Laszlo Ersek <address@hidden>
> Cc: address@hidden
> Signed-off-by: Jason Wang <address@hidden>
>
> ---
> 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