WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xsm:acm: Fix nul dereference bug (take 2)

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xsm:acm: Fix nul dereference bug (take 2).
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 01 Oct 2007 03:10:18 -0700
Delivery-date: Mon, 01 Oct 2007 03:11:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191216985 -3600
# Node ID 0416abdd0efd0be99edbc6337e3a8e5ef59a76ea
# Parent  db075ecf29b2c7bd677a9b61b6d4ef136f686aef
xsm:acm: Fix nul dereference bug (take 2).
Signed-off-by: George Coker <gscoker@xxxxxxxxxxxxxx>
---
 xen/include/xsm/acm/acm_core.h  |    2 +-
 xen/include/xsm/acm/acm_hooks.h |    4 ++--
 xen/xsm/acm/acm_core.c          |   10 +++++++---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff -r db075ecf29b2 -r 0416abdd0efd xen/include/xsm/acm/acm_core.h
--- a/xen/include/xsm/acm/acm_core.h    Mon Oct 01 06:35:40 2007 +0100
+++ b/xen/include/xsm/acm/acm_core.h    Mon Oct 01 06:36:25 2007 +0100
@@ -154,7 +154,7 @@ static inline int acm_array_append_tuple
 
 /* protos */
 int acm_init_domain_ssid(struct domain *, ssidref_t ssidref);
-void acm_free_domain_ssid(struct acm_ssid_domain *ssid);
+void acm_free_domain_ssid(struct domain *);
 int acm_init_binary_policy(u32 policy_code);
 int acm_set_policy(XEN_GUEST_HANDLE_64(void) buf, u32 buf_size);
 int do_acm_set_policy(void *buf, u32 buf_size, int is_bootpolicy,
diff -r db075ecf29b2 -r 0416abdd0efd xen/include/xsm/acm/acm_hooks.h
--- a/xen/include/xsm/acm/acm_hooks.h   Mon Oct 01 06:35:40 2007 +0100
+++ b/xen/include/xsm/acm/acm_hooks.h   Mon Oct 01 06:36:25 2007 +0100
@@ -258,7 +258,7 @@ static inline void acm_domain_destroy(st
             acm_secondary_ops->domain_destroy(ssid, d);
         /* free security ssid for the destroyed domain (also if null policy */
         acm_domain_ssid_off_list(ssid);
-        acm_free_domain_ssid((struct acm_ssid_domain *)(ssid));
+        acm_free_domain_ssid(d);
     }
 }
 
@@ -294,7 +294,7 @@ static inline int acm_domain_create(stru
     {
         acm_domain_ssid_onto_list(d->ssid);
     } else {
-        acm_free_domain_ssid(d->ssid);
+        acm_free_domain_ssid(d);
     }
 
 error_out:
diff -r db075ecf29b2 -r 0416abdd0efd xen/xsm/acm/acm_core.c
--- a/xen/xsm/acm/acm_core.c    Mon Oct 01 06:35:40 2007 +0100
+++ b/xen/xsm/acm/acm_core.c    Mon Oct 01 06:36:25 2007 +0100
@@ -361,7 +361,7 @@ int acm_init_domain_ssid(struct domain *
     {
         printk("%s: ERROR instantiating individual ssids for domain 0x%02x.\n",
                __func__, subj->domain_id);
-        acm_free_domain_ssid(ssid);
+        acm_free_domain_ssid(subj);
         return ACM_INIT_SSID_ERROR;
     }
 
@@ -372,8 +372,10 @@ int acm_init_domain_ssid(struct domain *
 
 
 void
-acm_free_domain_ssid(struct acm_ssid_domain *ssid)
-{
+acm_free_domain_ssid(struct domain *d)
+{
+    struct acm_ssid_domain *ssid = d->ssid;
+    
     /* domain is already gone, just ssid is left */
     if (ssid == NULL)
         return;
@@ -387,6 +389,8 @@ acm_free_domain_ssid(struct acm_ssid_dom
     ssid->secondary_ssid = NULL;
 
     xfree(ssid);
+    d->ssid = NULL;
+    
     printkd("%s: Freed individual domain ssid (domain=%02x).\n",
             __func__, id);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xsm:acm: Fix nul dereference bug (take 2)., Xen patchbot-unstable <=