[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.17] xen/xsm: make getdomaininfo xsm dummy checks more stringent



commit c5915a56fb49d635447586b121f5dcd44537935e
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Thu Jun 4 21:42:55 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jun 4 22:29:10 2026 +0100

    xen/xsm: make getdomaininfo xsm dummy checks more stringent
    
    Today the dummy XSM privilege checks for getdomaininfo are less
    stringent than possible: they basically rely on the general
    sysctl/domctl entry check to do all tests and then do the test with
    the XSM_HOOK privilege, which is an "allow all" default.
    
    Instead of XSM_HOOK use XSM_XS_PRIV, which is the privilege really
    wanted. Note that this test is still wider than the sysctl entry test,
    but there is no easy way to make both domctl and sysctl happy at the
    same time.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
    master commit: 5793b84c5e8fb268f94e7fde7816799e66945a73
    master date: 2024-12-16 13:06:55 +0100
---
 xen/common/domctl.c     | 2 +-
 xen/common/sysctl.c     | 2 +-
 xen/include/xsm/dummy.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 96ca55a421..5824398183 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -556,7 +556,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
         if ( d == NULL )
             goto getdomaininfo_out;
 
-        ret = xsm_getdomaininfo(XSM_HOOK, d);
+        ret = xsm_getdomaininfo(XSM_XS_PRIV, d);
         if ( ret )
             goto getdomaininfo_out;
 
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 0cbfe8bd44..4c7551c5d9 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -89,7 +89,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
             if ( num_domains == op->u.getdomaininfolist.max_domains )
                 break;
 
-            if ( xsm_getdomaininfo(XSM_HOOK, d) )
+            if ( xsm_getdomaininfo(XSM_XS_PRIV, d) )
                 continue;
 
             getdomaininfo(d, &info);
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 3286befeca..4b5f07ad27 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -137,7 +137,7 @@ static XSM_INLINE int cf_check xsm_domain_create(
 static XSM_INLINE int cf_check xsm_getdomaininfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
-    XSM_ASSERT_ACTION(XSM_HOOK);
+    XSM_ASSERT_ACTION(XSM_XS_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.