Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 2004 15:41:39 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 55164 for review
Message-ID:  <200406171541.i5HFfdwC014826@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55164

Change 55164 by rwatson@rwatson_tislabs on 2004/06/17 15:41:00

	When tearing down a label, assert that it was properly
	initialized to help catch label corruption and multiple
	freeing.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac/mac_label.c#4 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/mac/mac_label.c#4 (text+ko) ====

@@ -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
@@ -75,6 +75,8 @@
 
 	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406171541.i5HFfdwC014826>