svn commit: r303651 - head/sys/net
Conrad E. Meyer
cem at FreeBSD.org
Mon Aug 1 23:07:33 UTC 2016
Author: cem
Date: Mon Aug 1 23:07:31 2016
New Revision: 303651
URL: https://svnweb.freebsd.org/changeset/base/303651
Log:
rtentry: Initialize rt_mtx with MTX_NEW
The "rtentry" zone does not use UMA_ZONE_ZINIT, so it is invalid to assume the
mutex's memory will be zero. Without MTX_NEW, garbage backing memory may
trigger the "re-initializing a mutex" assertion.
PR: 200991
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>
Modified:
head/sys/net/route.h
Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h Mon Aug 1 22:57:03 2016 (r303650)
+++ head/sys/net/route.h Mon Aug 1 23:07:31 2016 (r303651)
@@ -360,7 +360,7 @@ struct rt_addrinfo {
|| (ifp)->if_link_state == LINK_STATE_UP)
#define RT_LOCK_INIT(_rt) \
- mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
+ mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW)
#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx)
#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx)
#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx)
More information about the svn-src-head
mailing list