svn commit: r287415 - head/sys/vm

Mateusz Guzik mjg at FreeBSD.org
Wed Sep 2 23:09:02 UTC 2015


Author: mjg
Date: Wed Sep  2 23:09:01 2015
New Revision: 287415
URL: https://svnweb.freebsd.org/changeset/base/287415

Log:
  Don't trash memory from UMA_ZONE_NOFREE zones.
  
  Objects obtained from such zones are supposed to retain type stability,
  which was violated by aforementioned trashing.
  
  This is a follow-up to r284861.
  
  Discussed with:		kib

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Wed Sep  2 22:48:41 2015	(r287414)
+++ head/sys/vm/uma_core.c	Wed Sep  2 23:09:01 2015	(r287415)
@@ -1946,8 +1946,8 @@ uma_zcreate(const char *name, size_t siz
 	 * destructor, pass UMA constructor/destructor which checks for
 	 * memory use after free.
 	 */
-	if ((!(flags & UMA_ZONE_ZINIT)) && ctor == NULL && dtor == NULL &&
-	    uminit == NULL && fini == NULL) {
+	if ((!(flags & (UMA_ZONE_ZINIT | UMA_ZONE_NOFREE))) &&
+	    ctor == NULL && dtor == NULL && uminit == NULL && fini == NULL) {
 		args.ctor = trash_ctor;
 		args.dtor = trash_dtor;
 		args.uminit = trash_init;


More information about the svn-src-head mailing list