summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_label.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-10-22 11:08:52 +0000
committerrwatson <rwatson@FreeBSD.org>2004-10-22 11:08:52 +0000
commit705746618befcb043232cb6bc8fb61708da3974e (patch)
treed20ab32b8079625bc1ce377381ad48510befc652 /sys/security/mac/mac_label.c
parent730226a1f3678a2ade4519189bd2db3b82f3186b (diff)
downloadFreeBSD-src-705746618befcb043232cb6bc8fb61708da3974e.zip
FreeBSD-src-705746618befcb043232cb6bc8fb61708da3974e.tar.gz
In the MAC label zone destructor, assert that the label is only
destroyed in an initialized state.
Diffstat (limited to 'sys/security/mac/mac_label.c')
-rw-r--r--sys/security/mac/mac_label.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/security/mac/mac_label.c b/sys/security/mac/mac_label.c
index 19bd5b0..f6d92ef 100644
--- a/sys/security/mac/mac_label.c
+++ b/sys/security/mac/mac_label.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003 Networks Associates Technology, Inc.
+ * Copyright (c) 2003-2004 Networks Associates Technology, Inc.
* All rights reserved.
*
* This software was developed for the FreeBSD Project in part by Network
@@ -76,6 +76,8 @@ mac_labelzone_dtor(void *mem, int size, void *arg)
KASSERT(size == sizeof(*label), ("mac_labelzone_dtor: wrong size\n"));
label = mem;
+ KASSERT(label->l_flags & MAC_FLAG_INITIALIZED,
+ ("mac_labelzone_dtor: label not initialized"));
#ifdef DIAGNOSTIC
bzero(label, sizeof(*label));
#else
OpenPOWER on IntegriCloud