qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 08/35] 9pfs: Fix CLI parsing crash on error


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 08/35] 9pfs: Fix CLI parsing crash on error
Date: Mon, 15 Oct 2018 14:00:24 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 10/15/18 6:52 AM, Markus Armbruster wrote:
Calling error_report() in a function that takes an Error ** argument
is suspicious.  9p-handle.c's handle_parse_opts() does that, and then
fails without setting an error.  Wrong.  Its caller crashes when it
tries to report the error:

     $ qemu-system-x86_64 -nodefaults -fsdev id=foo,fsdriver=handle
     qemu-system-x86_64: -fsdev id=foo,fsdriver=handle: warning: handle backend 
is deprecated
     qemu-system-x86_64: -fsdev id=foo,fsdriver=handle: fsdev: No path specified
     Segmentation fault (core dumped)

Screwed up when commit 91cda4e8f37 (v2.12.0) converted the function to
Error.  Fix by calling error_setg() instead of error_report().

Fixes: 91cda4e8f372602795e3a2f4bd2e3adaf9f82255
Cc: Greg Kurz <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Acked-by: Greg Kurz <address@hidden>
---
  hw/9pfs/9p-handle.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <address@hidden>


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]