All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Marcel Apfelbaum" <marcel@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH 0/3] Remove artificial length limits when parsing options
Date: Mon, 16 Apr 2018 12:17:40 +0100	[thread overview]
Message-ID: <20180416111743.8473-1-berrange@redhat.com> (raw)

A user trying out SMBIOS "OEM strings" feature reported that the data
they are exposing to the guest was truncated at 1023 bytes, which breaks
the app consuming in the guest. After searching for the cause I
eventually found that the QemuOpts parsing is using fixed length 1024
byte array for option values and 128 byte array for key names.

We can certainly debate whether it is sane to have such long command
line argument values (it is not sane), but if the OS was capable of
exec'ing QEMU with such an ARGV array, there is little good reason for
imposing an artificial length restriction when parsing it. Even worse is
that we silently truncate without reporting an error when hitting limits
resulting in a semantically incorrect behaviour, possibly even leading
to security flaws depending on the data that was truncated.

Thus this patch series removes the artificial length limits by killing
the fixed length buffers.

Separately I intend to make it possible to read "OEM strings" data from
a file, to avoid need to have long command line args.

Daniel P. Berrangé (3):
  accel: use g_strsplit for parsing accelerator names
  opts: don't silently truncate long parameter keys
  opts: don't silently truncate long option values

 accel/accel.c          |  16 +++---
 hw/i386/multiboot.c    |  33 +++++++----
 include/qemu/option.h  |   3 +-
 tests/test-qemu-opts.c |  18 ------
 util/qemu-option.c     | 150 ++++++++++++++++++++++++++-----------------------
 5 files changed, 108 insertions(+), 112 deletions(-)

-- 
2.14.3

             reply	other threads:[~2018-04-16 11:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 11:17 Daniel P. Berrangé [this message]
2018-04-16 11:17 ` [Qemu-devel] [PATCH 1/3] accel: use g_strsplit for parsing accelerator names Daniel P. Berrangé
2018-04-16 11:23   ` Philippe Mathieu-Daudé
2018-04-16 11:17 ` [Qemu-devel] [PATCH 2/3] opts: don't silently truncate long parameter keys Daniel P. Berrangé
2018-04-16 11:17 ` [Qemu-devel] [PATCH 3/3] opts: don't silently truncate long option values Daniel P. Berrangé
2018-04-16 11:50 ` [Qemu-devel] [PATCH 0/3] Remove artificial length limits when parsing options Paolo Bonzini
2018-04-16 16:30 ` Markus Armbruster
2018-04-16 16:38   ` Daniel P. Berrangé
2018-04-16 18:13     ` Markus Armbruster
2018-04-16 18:42       ` Daniel P. Berrangé

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=20180416111743.8473-1-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.