All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qemu_opts_parse(): always check return value
Date: Tue, 10 Dec 2013 05:58:45 +0100	[thread overview]
Message-ID: <52A69F85.10600@redhat.com> (raw)
In-Reply-To: <87eh6074ye.fsf@blackfin.pond.sub.org>

On 11/28/13 19:32, Markus Armbruster wrote:
> Laszlo Ersek <lersek@redhat.com> writes:
> 
>> qemu_opts_parse() can always return NULL, even if the QemuOptsList.desc in
>> question would be trivial to satisfy (eg. because it's empty). For
>> example:
>>
>> qemu_opts_parse()
>>   opts_parse()
>>     qemu_opts_create()
>>       id_wellformed()
>>
>> In practice:
>>
>>   $ .../qemu-system-x86_64 -acpitable id=3
>>   qemu-system-x86_64: -acpitable id=3: Parameter 'id' expects an identifier
>>   **
>>   ERROR:vl.c:3491:main: assertion failed: (opts != NULL)
>>   Aborted (core dumped)
>>
>>   $ .../qemu-system-x86_64 -smbios id=3
>>   qemu-system-x86_64: -smbios id=3: Parameter 'id' expects an identifier
>>   Segmentation fault (core dumped)
>>
>> I checked all qemu_opts_parse() invocations (and all drive_def()
>> invocations too, because it blindly forwards the former's retval). Only
>> the two above examples look problematic.
>>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> 
> Your fix is fine.  I didn't redo your search for other unsafe uses.
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 

Ping -- please commit this.

Thanks
Laszlo

  reply	other threads:[~2013-12-10  4:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 17:12 [Qemu-devel] [PATCH] qemu_opts_parse(): always check return value Laszlo Ersek
2013-11-28 18:32 ` Markus Armbruster
2013-12-10  4:58   ` Laszlo Ersek [this message]
2013-12-16 14:56 ` Michael S. Tsirkin

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=52A69F85.10600@redhat.com \
    --to=lersek@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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.