From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/
Date: Tue, 15 Mar 2016 16:47:17 +0200 [thread overview]
Message-ID: <1458053080-29170-1-git-send-email-mst@redhat.com> (raw)
Allowing arbitary file names on command line is setting us up for
failure: future guests will look for a specific QEMU-specified name and
will get confused finding a user file there.
We do warn but people are conditioned to ignore warnings by now,
so at best that will help users debug problem, not avoid it.
Disable this by default, so distros don't get to deal with it,
but leave an option for developers to configure this in,
with scary warnings so people only do it if they know
what they are doing.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
changes from v1:
add configure option
configure | 7 +++++++
vl.c | 3 +++
2 files changed, 10 insertions(+)
diff --git a/configure b/configure
index 2b32876..e5a692f 100755
--- a/configure
+++ b/configure
@@ -256,6 +256,7 @@ sysconfdir="\${prefix}/etc"
local_statedir="\${prefix}/var"
confsuffix="/qemu"
slirp="yes"
+unsafe_fw_cfg="no"
oss_lib=""
bsd="no"
linux="no"
@@ -875,6 +876,8 @@ for opt do
;;
--enable-vnc-png) vnc_png="yes"
;;
+ --enable-unsafe-fw-cfg) unsafe_fw_cfg="yes"
+ ;;
--disable-slirp) slirp="no"
;;
--disable-uuid) uuid="no"
@@ -1286,6 +1289,7 @@ Advanced options (experts only):
Available backends: $($python $source_path/scripts/tracetool.py --list-backends)
--with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-<pid>
+ --enable-unsafe-fw-cfg Enable loading fw cfg entries at unsafe paths (broken! don't use in production!)
--disable-slirp disable SLIRP userspace network connectivity
--enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
--oss-lib path to OSS library
@@ -4911,6 +4915,9 @@ fi
if test "$profiler" = "yes" ; then
echo "CONFIG_PROFILER=y" >> $config_host_mak
fi
+if test "$unsafe_fw_cfg" = "yes" ; then
+ echo "CONFIG_UNSAFE_FW_CFG=y" >> $config_host_mak
+fi
if test "$slirp" = "yes" ; then
echo "CONFIG_SLIRP=y" >> $config_host_mak
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
diff --git a/vl.c b/vl.c
index 7a28982..5adf217 100644
--- a/vl.c
+++ b/vl.c
@@ -2321,6 +2321,9 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
if (strncmp(name, "opt/", 4) != 0) {
error_report("warning: externally provided fw_cfg item names "
"should be prefixed with \"opt/\"");
+#ifndef CONFIG_UNSAFE_FW_CFG
+ return -1;
+#endif
}
if (nonempty_str(str)) {
size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
--
MST
next reply other threads:[~2016-03-15 14:47 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-15 14:47 Michael S. Tsirkin [this message]
2016-03-16 16:29 ` [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/ Markus Armbruster
2016-03-16 16:50 ` Michael S. Tsirkin
2016-03-16 18:15 ` Gabriel L. Somlo
2016-03-16 18:35 ` Laszlo Ersek
2016-03-16 18:43 ` Michael S. Tsirkin
2016-03-16 19:15 ` Laszlo Ersek
2016-03-16 20:22 ` Michael S. Tsirkin
2016-03-16 20:24 ` Michael S. Tsirkin
2016-03-16 20:31 ` Michael S. Tsirkin
2016-03-17 8:49 ` Laszlo Ersek
2016-03-17 9:40 ` Paolo Bonzini
2016-03-17 11:32 ` Michael S. Tsirkin
2016-03-17 13:12 ` Paolo Bonzini
2016-03-17 13:15 ` Michael S. Tsirkin
2016-03-17 8:42 ` Gerd Hoffmann
2016-03-17 9:43 ` Laszlo Ersek
2016-03-17 10:22 ` Gerd Hoffmann
2016-03-17 13:28 ` Laszlo Ersek
2016-03-17 13:35 ` Michael S. Tsirkin
2016-03-17 13:37 ` Paolo Bonzini
2016-03-17 16:59 ` Gerd Hoffmann
2016-03-17 13:23 ` Michael S. Tsirkin
2016-03-17 9:49 ` Laszlo Ersek
2016-03-17 10:09 ` Markus Armbruster
2016-03-17 13:13 ` Michael S. Tsirkin
2016-03-17 13:30 ` Paolo Bonzini
2016-03-17 13:49 ` Laszlo Ersek
2016-03-17 13:49 ` Michael S. Tsirkin
2016-03-17 13:55 ` Paolo Bonzini
2016-03-17 14:17 ` Michael S. Tsirkin
2016-03-17 14:50 ` Paolo Bonzini
2016-03-17 15:40 ` Michael S. Tsirkin
2016-03-17 17:17 ` Gerd Hoffmann
2016-03-17 19:35 ` Paolo Bonzini
2016-03-17 19:55 ` 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=1458053080-29170-1-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).