From patchwork Wed Nov 2 13:00:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Smalley X-Patchwork-Id: 9409047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B9AE60721 for ; Wed, 2 Nov 2016 12:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79D542A133 for ; Wed, 2 Nov 2016 12:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CD152A14B; Wed, 2 Nov 2016 12:59:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C8832A133 for ; Wed, 2 Nov 2016 12:59:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.31,583,1473120000"; d="scan'208";a="522451" IronPort-PHdr: =?us-ascii?q?9a23=3AM9/rEhaWic6T3eCiuhf58KX/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcizbnLW6fgltlLVR4KTs6sC0LuM9fC7EjZYqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZv?= =?us-ascii?q?IaytQ8iJ3p7xh7v5ocWbSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYe?= =?us-ascii?q?VcyDAgD1uSmxHh+pX4p8Y7oGxtofZpy+psGeW/Jfx5HvRkC2E9PmQ04tD7nQXS?= =?us-ascii?q?RguIoH0HWyMZlQQbLRLC6UTBQprpsib8/tF40S2eMNy+Gas4Qhy+/qxrT1nuky?= =?us-ascii?q?5BODknpjKEwvdshb5W9Ury7yd0xJTZNcTPbPc=3D?= X-IPAS-Result: =?us-ascii?q?A2HsBABD4hlY/wHyM5BdHAEBBAEBCgEBFwEBBAEBCgEBgwE?= =?us-ascii?q?BAQEBAR+BRQ+0PYY9KYglUwEBAQEBAQEBAgECXyiCMwQDEwWCFwIkExQgCwMDC?= =?us-ascii?q?QIXKQgIAwEtFR8LBRgEiDW6CCWMYIJJAhEBaIUUBZodkDoCigqFegJJkFNUVgg?= =?us-ascii?q?JhTNWhiEPF2GBNAEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 02 Nov 2016 12:59:23 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uA2CviuS023240; Wed, 2 Nov 2016 08:58:05 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id uA2CvgbG058002 for ; Wed, 2 Nov 2016 08:57:42 -0400 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uA2CvgBe023234; Wed, 2 Nov 2016 08:57:42 -0400 From: Stephen Smalley To: selinux@tycho.nsa.gov Subject: [PATCH] libsemanage: fix kernel pathname in semanage_verify_kernel() Date: Wed, 2 Nov 2016 09:00:27 -0400 Message-Id: <1478091627-8111-1-git-send-email-sds@tycho.nsa.gov> X-Mailer: git-send-email 2.7.4 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: Stephen Smalley MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP Building with CC=clang, we get the following errors: semanage_store.c:2177:20: error: implicit conversion from enumeration type 'enum semanage_final_defs' to different enumeration type 'enum semanage_store_defs' [-Werror,-Wenum-conversion] semanage_path(SEMANAGE_FINAL_TMP, SEMANAGE_KERNEL); ~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~ semanage_store.c:2177:40: error: implicit conversion from enumeration type 'enum semanage_final_path_defs' to different enumeration type 'enum semanage_sandbox_defs' [-Werror,-Wenum-conversion] semanage_path(SEMANAGE_FINAL_TMP, SEMANAGE_KERNEL); ~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~ This is an actual bug; semanage_verify_kernel() was never updated to use semanage_final_path() when the rest were converted. Fix it. This pathname is only used if a kernel policy verifier is specified in semanage.conf, so this is not used by default. Signed-off-by: Stephen Smalley --- libsemanage/src/semanage_store.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c index ca29257..58a58ef 100644 --- a/libsemanage/src/semanage_store.c +++ b/libsemanage/src/semanage_store.c @@ -2174,7 +2174,7 @@ int semanage_verify_kernel(semanage_handle_t * sh) { int retval = -1; const char *kernel_filename = - semanage_path(SEMANAGE_FINAL_TMP, SEMANAGE_KERNEL); + semanage_final_path(SEMANAGE_FINAL_TMP, SEMANAGE_KERNEL); semanage_conf_t *conf = sh->conf; external_prog_t *e; if (conf->kernel_prog == NULL) {