Skip to contentSkip to conversation

Test sharing as part of the authorization check.

PATCH New Stefan Berger 1 participant 1 message Nov 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Test sharing as part of the authorization check.

Test the sharing as part of checking authorization. Protected the policy from being changed while the hooks are being called.

---
 xen-unstable.hg/xen/include/xsm/acm/acm_hooks.h |    2 +-
 xen-unstable.hg/xen/xsm/acm/acm_policy.c        |    5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
xen-unstable.hg/xen/include/xsm/acm/acm_hooks.h +1 -1
Index: root/xen-unstable.hg/xen/include/xsm/acm/acm_hooks.h
===================================================================
@@ -325,7 +325,7 @@ static inline int acm_authorization(ssid
              acm_secondary_ops->authorization(ssidref1, ssidref2)) {
         return ACM_ACCESS_DENIED;
     } else
-        return ACM_ACCESS_PERMITTED;
+        return acm_sharing(ssidref1, ssidref2);
 }
 
 
xen-unstable.hg/xen/xsm/acm/acm_policy.c +5 -0
Index: root/xen-unstable.hg/xen/xsm/acm/acm_policy.c
===================================================================
@@ -430,6 +430,9 @@ int
 acm_get_decision(ssidref_t ssidref1, ssidref_t ssidref2, u32 hook)
 {
     int ret = ACM_ACCESS_DENIED;
+
+    read_lock(&acm_bin_pol_rwlock);
+
     switch ( hook )
     {
 
@@ -447,6 +450,8 @@ acm_get_decision(ssidref_t ssidref1, ssi
         break;
     }
 
+    read_unlock(&acm_bin_pol_rwlock);
+
     printkd("%s: ssid1=%x, ssid2=%x, decision=%s.\n",
             __func__, ssidref1, ssidref2,
             (ret == ACM_ACCESS_PERMITTED) ? "GRANTED" : "DENIED");

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel