From patchwork Thu Jun 9 14:47:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel De Graaf X-Patchwork-Id: 9167195 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 62EB1604DB for ; Thu, 9 Jun 2016 14:49:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5563E264F4 for ; Thu, 9 Jun 2016 14:49:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A6F02834F; Thu, 9 Jun 2016 14:49:35 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F27E5264F4 for ; Thu, 9 Jun 2016 14:49:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB1FC-00056n-4u; Thu, 09 Jun 2016 14:47:38 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB1FA-0004yM-40 for xen-devel@lists.xen.org; Thu, 09 Jun 2016 14:47:36 +0000 Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id 21/20-04455-78189575; Thu, 09 Jun 2016 14:47:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsXCoZPKqdvWGBl uMPWPlMWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvH62nXmgv/CFb/etLE2MG4S6GLk5JAQ8JP4 8/EyYxcjFwenwGwWibYla5lBHAmBY4wSP28fYwdxhASWMkq0XX/PBtIiJLCVUaL5ZjaIzSagK 7Hg4EomEFtEQFri2meQUZwczALaEs3vZrKD2MICxhL7JlxkAbFZBFQlZu5ZyQpi8wq4StyYM4 0J4gw5iW1b9oD1cgLF35x/CbSLA2iXi8TCn14TGPkWMDKsYlQvTi0qSy3SNdNLKspMzyjJTcz M0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAgMk3oGBsYdjFfanA8xSnIwKYnyepdEhgvxJeWnVGYk FmfEF5XmpBYfYpTh4FCS4C1pAMoJFqWmp1akZeYAAxYmLcHBoyTC+6EeKM1bXJCYW5yZDpE6x agoJc5rAdInAJLIKM2Da4NFySVGWSlhXkYGBgYhnoLUotzMElT5V4ziHIxKwrz2IFN4MvNK4K a/AlrMBLR4+ZFwkMUliQgpqQbG/XsXPts5r8fJaI56jk/M093dPcdi4rzY2k4flp8QwvWIbek F9iNrZE8fafI+1vRJcVbnddfqDo2MX7NnXaowP9Moumhngyyz42cDkdNLokwW/dwYvFemKC9u gsYkxwvTbfonXNxhbjP95tkVoYUl5cvashXi87Vf5u17/IXvs0mcz9Zy9nlaSizFGYmGWsxFx YkAC+NvF40CAAA= X-Env-Sender: dgdegra@tycho.nsa.gov X-Msg-Ref: server-6.tower-31.messagelabs.com!1465483649!18348707!7 X-Originating-IP: [8.44.101.9] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63209 invoked from network); 9 Jun 2016 14:47:34 -0000 Received: from emsm-gh1-uea11.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) (8.44.101.9) by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 9 Jun 2016 14:47:34 -0000 X-IronPort-AV: E=Sophos;i="5.26,445,1459814400"; d="scan'208";a="16783295" IronPort-PHdr: =?us-ascii?q?9a23=3Arxb+9BA8iq/5bt84Adm0UyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP79psbcNUDSrc9gkEXOFd2CrakU2qyJ7uu/AyQp2tWojjMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3Dwdp?= =?us-ascii?q?POO9QteU1JTmkb/vsMKJKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu?= =?us-ascii?q?5NznlpL1/A1zz158O34YIxu38I46FpytREGZneU+x4COYATWduD2dg9MDt8BXO?= =?us-ascii?q?UwaLzn8dSXkN1ApFBU7C9h6pcI32t37Wv+x81S3SEcC+Yqo9UDrqu6tkRBLnki?= =?us-ascii?q?4vKy8y8GaRjNd5yq1cvkTy9FRE34fIbdTNZ7JFdaTHcIZfHzJM?= X-IPAS-Result: =?us-ascii?q?A2HIAwBJgFlX/wHyM5BeGgEBAQGDIIFTuQiECYYTAoE1TAE?= =?us-ascii?q?BAQEBAQICYieCMIIWAgQnUhAYOVcZiC++KgEBAQEGAgEkkACFDgWICJBNjicCi?= =?us-ascii?q?VmFRY9lVIIHHIFnIDKKCAEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2016 14:47:29 +0000 Received: from moss-nexus.infosec.tycho.ncsc.mil (moss-nexus [192.168.25.48]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u59ElSNG018061; Thu, 9 Jun 2016 10:47:29 -0400 From: Daniel De Graaf To: xen-devel@lists.xen.org Date: Thu, 9 Jun 2016 10:47:17 -0400 Message-Id: <1465483638-9489-15-git-send-email-dgdegra@tycho.nsa.gov> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465483638-9489-1-git-send-email-dgdegra@tycho.nsa.gov> References: <1465483638-9489-1-git-send-email-dgdegra@tycho.nsa.gov> Cc: Daniel De Graaf Subject: [Xen-devel] [PATCH 14/15] xsm: clean up unregistration X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The only possible value of original_ops was &dummy_xsm_ops, and unregister_xsm was never used. Signed-off-by: Daniel De Graaf Reviewed-by: Andrew Cooper Reviewed-by: Konrad Rzeszutek Wilk --- xen/include/xsm/xsm.h | 1 - xen/xsm/flask/flask_op.c | 4 +--- xen/xsm/flask/hooks.c | 3 --- xen/xsm/xsm_core.c | 16 ---------------- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 0d525ec..4b8843d 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -750,7 +750,6 @@ extern bool has_xsm_magic(paddr_t); #endif extern int register_xsm(struct xsm_operations *ops); -extern int unregister_xsm(struct xsm_operations *ops); extern struct xsm_operations dummy_xsm_ops; extern void xsm_fixup_ops(struct xsm_operations *ops); diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c index 3ad4bdc..719c2d7 100644 --- a/xen/xsm/flask/flask_op.c +++ b/xen/xsm/flask/flask_op.c @@ -58,8 +58,6 @@ static int flask_security_make_bools(void); extern int ss_initialized; -extern struct xsm_operations *original_ops; - static void __init parse_flask_param(char *s) { if ( !strcmp(s, "enforcing") ) @@ -243,7 +241,7 @@ static int flask_disable(void) flask_disabled = 1; /* Reset xsm_ops to the original module. */ - xsm_ops = original_ops; + xsm_ops = &dummy_xsm_ops; return 0; } diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 596ac0a..5e81ed4 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -35,8 +35,6 @@ #include #include -struct xsm_operations *original_ops = NULL; - static u32 domain_sid(struct domain *dom) { struct domain_security_struct *dsec = dom->ssid; @@ -1841,7 +1839,6 @@ __init void flask_init(void) avc_init(); - original_ops = xsm_ops; if ( register_xsm(&flask_ops) ) panic("Flask: Unable to register with XSM"); diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index 2c4d576..4a264c2 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -149,22 +149,6 @@ int __init register_xsm(struct xsm_operations *ops) return 0; } - -int unregister_xsm(struct xsm_operations *ops) -{ - if ( ops != xsm_ops ) - { - printk("%s: trying to unregister " - "a security_opts structure that is not " - "registered, failing.\n", __FUNCTION__); - return -EINVAL; - } - - xsm_ops = &dummy_xsm_ops; - - return 0; -} - #endif long do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op)