From: Stefan Berger Subject: [PATCH][Xen][ACM] Remove aggregate set calculations for Domain-0 Date: Fri, 23 Nov 2007 13:43:13 -0500 Message-ID: <1195843393.3966.1.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-eTPiza1JyAH24RfI+MOc" 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 --=-eTPiza1JyAH24RfI+MOc Content-Type: text/plain Content-Transfer-Encoding: 7bit Since the pre_domain_create hook is called also for Dom-0, this special case handling is not necessary anymore. Signed-off-by: Stefan Berger --=-eTPiza1JyAH24RfI+MOc Content-Disposition: attachment; filename=acm_remove_dom0_post_create_calcs.diff Content-Type: text/x-patch; name=acm_remove_dom0_post_create_calcs.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/xen/xsm/acm/acm_chinesewall_hooks.c =================================================================== --- root.orig/xen-unstable.hg/xen/xsm/acm/acm_chinesewall_hooks.c +++ root/xen-unstable.hg/xen/xsm/acm/acm_chinesewall_hooks.c @@ -547,7 +547,7 @@ static int _chwall_pre_domain_create(voi static void _chwall_post_domain_create(domid_t domid, ssidref_t ssidref) { - int i, j; + int i; ssidref_t chwall_ssidref; chwall_ssidref = GET_SSIDREF(ACM_CHINESE_WALL_POLICY, ssidref); @@ -556,48 +556,6 @@ static void _chwall_post_domain_create(d chwall_bin_pol.running_types[i] += chwall_bin_pol.ssidrefs[chwall_ssidref * chwall_bin_pol.max_types + i]; - if ( domid ) - return; - - /* Xen does not call pre-create hook for DOM0; - * to consider type conflicts of any domain with DOM0, we need - * to adjust the conflict_aggregate for DOM0 here the same way it - * is done for non-DOM0 domains in the pre-hook */ - printkd("%s: adjusting security state for DOM0 (ssidref=%x, chwall_ssidref=%x).\n", - __func__, ssidref, chwall_ssidref); - - /* chinese wall conflict set adjustment (so that other - * other domains simultaneously created are evaluated against this new set)*/ - for ( i = 0; i < chwall_bin_pol.max_conflictsets; i++ ) - { - int common = 0; - /* check if conflict_set_i and ssidref have common types */ - for ( j = 0; j < chwall_bin_pol.max_types; j++ ) - if ( chwall_bin_pol. - conflict_sets[i * chwall_bin_pol.max_types + j] - && chwall_bin_pol.ssidrefs[chwall_ssidref * - chwall_bin_pol.max_types + j] ) - { - common = 1; - break; - } - - if ( common == 0 ) - { - /* try next conflict set */ - continue; - } - - /* now add types of the conflict set to conflict_aggregate_set - (except types in chwall_ssidref) */ - for ( j = 0; j < chwall_bin_pol.max_types; j++ ) - if ( chwall_bin_pol. - conflict_sets[i * chwall_bin_pol.max_types + j] - && !chwall_bin_pol.ssidrefs[chwall_ssidref * - chwall_bin_pol.max_types + j] ) - chwall_bin_pol.conflict_aggregate_set[j]++; - } - return; } --=-eTPiza1JyAH24RfI+MOc 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 --=-eTPiza1JyAH24RfI+MOc--