From: Eduardo Otubo <otubo@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: pmoore@redhat.com, coreyb@linux.vnet.ibm.com,
Eduardo Otubo <otubo@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCHv3 3/3] seccomp: general fixes
Date: Fri, 6 Sep 2013 16:21:48 -0300 [thread overview]
Message-ID: <1378495308-24560-4-git-send-email-otubo@linux.vnet.ibm.com> (raw)
In-Reply-To: <1378495308-24560-1-git-send-email-otubo@linux.vnet.ibm.com>
1) On qemu-seccomp.c:255, the variable ctx was being used
uninitialized; now it's initialized with NULL and it's being checked at
the end of the function.
2) Changed the name of the command line option from "enable" to
"sandbox" for a better understanding from user side.
Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
---
qemu-seccomp.c | 5 +++--
vl.c | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index 5e85eb5..f39d636 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -252,7 +252,7 @@ seccomp_return:
int seccomp_start(int list_type)
{
int rc = 0;
- scmp_filter_ctx ctx;
+ scmp_filter_ctx ctx = NULL;
switch (list_type) {
case WHITELIST:
@@ -280,6 +280,7 @@ int seccomp_start(int list_type)
rc = seccomp_load(ctx);
seccomp_return:
- seccomp_release(ctx);
+ if (!ctx)
+ seccomp_release(ctx);
return rc;
}
diff --git a/vl.c b/vl.c
index 909f685..129919d 100644
--- a/vl.c
+++ b/vl.c
@@ -323,11 +323,11 @@ static QemuOptsList qemu_rtc_opts = {
static QemuOptsList qemu_sandbox_opts = {
.name = "sandbox",
- .implied_opt_name = "enable",
+ .implied_opt_name = "sandbox",
.head = QTAILQ_HEAD_INITIALIZER(qemu_sandbox_opts.head),
.desc = {
{
- .name = "enable",
+ .name = "sandbox",
.type = QEMU_OPT_BOOL,
},{
.name = "strict",
@@ -1036,7 +1036,7 @@ static int parse_sandbox(QemuOpts *opts, void *opaque)
{
const char * strict_value = NULL;
/* FIXME: change this to true for 1.3 */
- if (qemu_opt_get_bool(opts, "enable", false)) {
+ if (qemu_opt_get_bool(opts, "sandbox", false)) {
#ifdef CONFIG_SECCOMP
if (seccomp_start(WHITELIST) < 0) {
qerror_report(ERROR_CLASS_GENERIC_ERROR,
--
1.8.3.1
next prev parent reply other threads:[~2013-09-06 19:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 19:21 [Qemu-devel] [PATCHv2 0/3] seccomp: adding blacklist support with command line Eduardo Otubo
2013-09-06 19:21 ` [Qemu-devel] [PATCHv2 1/3] seccomp: adding blacklist support Eduardo Otubo
2013-09-09 3:49 ` Lei Li
2013-09-11 16:29 ` Corey Bryant
2013-09-06 19:21 ` [Qemu-devel] [PATCHv2 2/3] seccomp: adding command line support for blacklist Eduardo Otubo
2013-09-11 16:45 ` Corey Bryant
2013-09-11 16:49 ` Daniel P. Berrange
2013-09-17 13:01 ` Eduardo Otubo
2013-09-17 13:06 ` Daniel P. Berrange
2013-09-17 14:43 ` Paul Moore
2013-09-17 17:14 ` Eduardo Otubo
2013-09-17 18:08 ` Eduardo Otubo
2013-09-17 19:17 ` Corey Bryant
2013-09-17 20:16 ` Eduardo Otubo
2013-09-18 7:38 ` Daniel P. Berrange
2013-09-18 15:53 ` Paul Moore
2013-09-18 15:59 ` Daniel P. Berrange
2013-09-18 16:19 ` Paul Moore
2013-09-18 16:32 ` Daniel P. Berrange
2013-09-18 17:24 ` Corey Bryant
2013-09-18 17:37 ` Paul Moore
2013-09-18 7:35 ` Daniel P. Berrange
2013-09-06 19:21 ` Eduardo Otubo [this message]
2013-09-11 16:56 ` [Qemu-devel] [PATCHv3 3/3] seccomp: general fixes Corey Bryant
2013-10-09 0:40 ` Eduardo Otubo
-- strict thread matches above, loose matches on Subject: below --
2013-10-09 0:42 [Qemu-devel] [PATCHv3 0/3] seccomp: adding blacklist support with command line Eduardo Otubo
2013-10-09 0:42 ` [Qemu-devel] [PATCHv3 3/3] seccomp: general fixes Eduardo Otubo
2013-10-09 21:38 ` Paul Moore
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=1378495308-24560-4-git-send-email-otubo@linux.vnet.ibm.com \
--to=otubo@linux.vnet.ibm.com \
--cc=coreyb@linux.vnet.ibm.com \
--cc=pmoore@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).