freebsd-skq/sys/cddl
Alan Somers 4e3ab010a2 Fix rare double free in vdev_geom_attrchanged
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
	Don't drop the g_topology_lock before freeing old_physpath. That
	opens up a race where one thread can call vdev_geom_attrchanged,
	set old_physpath, drop the g_topology_lock, then block trying to
	acquire the SCL_STATE lock. Then another thread can come into
	vdev_geom_attrchanged, set old_physpath to the same value, and
	proceed to free it. When the first thread resumes, it will free
	the same location.

	It turns out that the SCL_STATE lock isn't needed. It was
	originally added by gibbs to protect vd->vdev_physpath while
	updating the same. However, the update process subsequently was
	switched to an atomic operation (a pointer swap). Now, there is
	no need for the SCL_STATE lock, and hence no need to drop the
	g_topology_lock.

Reviewed by:	delphij
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D5413
2016-04-12 19:11:14 +00:00
..
boot/zfs Fix const conversion warning in lz4_decompress 2016-01-06 20:28:09 +00:00
compat/opensolaris remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat 2016-04-02 16:25:46 +00:00
contrib/opensolaris Fix rare double free in vdev_geom_attrchanged 2016-04-12 19:11:14 +00:00
dev Initialize SDT probes during SI_SUB_DTRACE_PROVIDER. 2016-04-10 01:24:27 +00:00