From: Laszlo Ersek <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] usb-redir: fix use-after-free
Date: Wed, 31 Jul 2013 14:25:02 +0200 [thread overview]
Message-ID: <51F9021E.9020801@redhat.com> (raw)
In-Reply-To: <1375262511-28604-1-git-send-email-kraxel@redhat.com>
On 07/31/13 11:21, Gerd Hoffmann wrote:
> Reinitialize dev->cs to NULL after deleting it, to make sure it isn't
> used afterwards.
>
> Reported-by: Martin Cerveny <M.Cerveny@computer.org>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/usb/redirect.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
> index 8b8c010..e3b9f32 100644
> --- a/hw/usb/redirect.c
> +++ b/hw/usb/redirect.c
> @@ -1334,6 +1334,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
> USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);
>
> qemu_chr_delete(dev->cs);
> + dev->cs = NULL;
> /* Note must be done after qemu_chr_close, as that causes a close event */
> qemu_bh_delete(dev->chardev_close_bh);
>
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
prev parent reply other threads:[~2013-07-31 12:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 9:21 [Qemu-devel] [PATCH] usb-redir: fix use-after-free Gerd Hoffmann
2013-07-31 12:25 ` Laszlo Ersek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F9021E.9020801@redhat.com \
--to=lersek@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.