diff mbox

[14/15] xsm: clean up unregistration

Message ID 1465483638-9489-15-git-send-email-dgdegra@tycho.nsa.gov (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel De Graaf June 9, 2016, 2:47 p.m. UTC
The only possible value of original_ops was &dummy_xsm_ops, and
unregister_xsm was never used.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 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(-)

Comments

Andrew Cooper June 9, 2016, 3:16 p.m. UTC | #1
On 09/06/16 15:47, Daniel De Graaf wrote:
> The only possible value of original_ops was &dummy_xsm_ops, and
> unregister_xsm was never used.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Konrad Rzeszutek Wilk June 17, 2016, 3:51 p.m. UTC | #2
On Thu, Jun 09, 2016 at 10:47:17AM -0400, Daniel De Graaf wrote:
> The only possible value of original_ops was &dummy_xsm_ops, and
> unregister_xsm was never used.
> 
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> ---
>  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 <objsec.h>
>  #include <conditional.h>
>  
> -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)
> -- 
> 2.5.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
diff mbox

Patch

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 <objsec.h>
 #include <conditional.h>
 
-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)