From: Stefan Berger Subject: [PATCH] [Xen] [ACM] Test sharing as part of the authorization check. Date: Mon, 19 Nov 2007 07:56:50 -0500 Message-ID: <1195477010.10795.4.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-nJSIKoIsSDATyazlKrwg" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --=-nJSIKoIsSDATyazlKrwg Content-Type: text/plain Content-Transfer-Encoding: 7bit Test the sharing as part of checking authorization. Protected the policy from being changed while the hooks are being called. Signed-off-by: Stefan Berger --=-nJSIKoIsSDATyazlKrwg Content-Disposition: attachment; filename=xen_acm_auth_with_sharing_check.diff Content-Type: text/x-vhdl; name=xen_acm_auth_with_sharing_check.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit --- 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(-) Index: root/xen-unstable.hg/xen/include/xsm/acm/acm_hooks.h =================================================================== --- root.orig/xen-unstable.hg/xen/include/xsm/acm/acm_hooks.h +++ 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); } Index: root/xen-unstable.hg/xen/xsm/acm/acm_policy.c =================================================================== --- root.orig/xen-unstable.hg/xen/xsm/acm/acm_policy.c +++ 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"); --=-nJSIKoIsSDATyazlKrwg Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-nJSIKoIsSDATyazlKrwg--