From patchwork Wed Dec 18 16:48:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Bryant X-Patchwork-Id: 302978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 631412C0090 for ; Thu, 19 Dec 2013 03:48:58 +1100 (EST) Received: from localhost ([::1]:39506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKIo-00076R-Ru for incoming@patchwork.ozlabs.org; Wed, 18 Dec 2013 11:48:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKIP-0006vt-7e for qemu-devel@nongnu.org; Wed, 18 Dec 2013 11:48:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtKIG-0005ET-B6 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 11:48:29 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:47317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKIG-0005Du-71 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 11:48:20 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Dec 2013 11:48:17 -0500 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 18 Dec 2013 11:48:15 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 2ED2B38C804A for ; Wed, 18 Dec 2013 11:48:12 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBIGmDRp3211640 for ; Wed, 18 Dec 2013 16:48:14 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBIGmDhG005210 for ; Wed, 18 Dec 2013 11:48:13 -0500 Received: from localhost ([9.80.95.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rBIGmCVH005191; Wed, 18 Dec 2013 11:48:12 -0500 From: Corey Bryant To: qemu-devel@nongnu.org Date: Wed, 18 Dec 2013 11:48:11 -0500 Message-Id: <1387385291-7825-1-git-send-email-coreyb@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121816-0320-0000-0000-00000200EFF2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.138 Cc: pmoore@redhat.com, Corey Bryant , aliguori@amazon.com, otubo@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH] seccomp: exit if seccomp_init() fails X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes a bug where we weren't exiting if seccomp_init() failed. Signed-off-by: Corey Bryant Reviewed-by: Eduardo Otubo Acked-by: Paul Moore --- qemu-seccomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index cf07869..b7c1253 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -231,6 +231,7 @@ int seccomp_start(void) ctx = seccomp_init(SCMP_ACT_KILL); if (ctx == NULL) { + rc = -1; goto seccomp_return; }