cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 77b56ef5c4488f32151018c06443c701d6173ce7 Mon Sep 17 00:00:00 2001
From: Paul Moore <pmoore@redhat.com>
Date: Fri, 20 Dec 2013 21:43:16 +0100
Subject: [PATCH 04/16] seccomp: exit if seccomp_init() fails

RH-Author: Paul Moore <pmoore@redhat.com>
Message-id: <20131220214316.2542.64440.stgit@localhost>
Patchwork-id: 56418
O-Subject: [RHEL7 qemu-kvm PATCH] seccomp: exit if seccomp_init() fails
Bugzilla: 1044845
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

From: Corey Bryant <coreyb@linux.vnet.ibm.com>

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1044845
Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6770015
Upstream: merged into the QEMU seccomp tree
          git://github.com/otubo/qemu.git seccomp
Testing: Tested by IBM, see BZ

	seccomp: exit if seccomp_init() fails

	This fixes a bug where we weren't exiting if seccomp_init() failed.

	Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
	Acked-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
	Acked-by: Paul Moore <pmoore@redhat.com>
        (cherry picked from commit 2a13f991123fa16841e6d94b02a9cc2c76d91725)
        Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 qemu-seccomp.c |    1 +
 1 file changed, 1 insertion(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 qemu-seccomp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index 906101f..fc48bdd 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -248,6 +248,7 @@ int seccomp_start(void)
 
     ctx = seccomp_init(SCMP_ACT_KILL);
     if (ctx == NULL) {
+        rc = -1;
         goto seccomp_return;
     }
 
-- 
1.7.1