xsm: return unlabeled instead of failing with ENOENT in get_page_sid
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 22 Sep 2010 17:26:01 +0000 (18:26 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 22 Sep 2010 17:26:01 +0000 (18:26 +0100)
It is better to return an unlabeled SID in the case where dsec is NULL
instead of bailing out with an error.

From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Keir Fraser <Keir.Fraser@eu.citrix.com>
xen/xsm/flask/hooks.c

index c58f8d71b6deb177c5f96512218c5960d2a186ad..1b36a9e913f017ce477b21a6146e79e188935827 100644 (file)
@@ -340,10 +340,7 @@ static int get_page_sid(struct page_info *page, u32 *sid)
         default:
             /*Pages are implicitly labeled by domain ownership!*/
             dsec = d->ssid;
-            if (dsec)
-                *sid = dsec->sid;
-            else
-                rc = -ENOENT;
+            *sid = dsec ? dsec->sid : SECINITSID_UNLABELED;
         break;
     }