tmpfs_node_init: use MTX_NEW on lock from uninitialized memory

Reported by:	netchild
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45364
This commit is contained in:
Ryan Libby 2024-05-26 10:20:52 -07:00
parent c68db4608e
commit 6bd3f23a2a

View File

@ -349,7 +349,7 @@ tmpfs_node_init(void *mem, int size, int flags)
node = mem; node = mem;
node->tn_id = 0; node->tn_id = 0;
mtx_init(&node->tn_interlock, "tmpfsni", NULL, MTX_DEF); mtx_init(&node->tn_interlock, "tmpfsni", NULL, MTX_DEF | MTX_NEW);
node->tn_gen = arc4random(); node->tn_gen = arc4random();
return (0); return (0);
} }