diff options
author | kib <kib@FreeBSD.org> | 2016-06-13 03:42:46 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-06-13 03:42:46 +0000 |
commit | 528a6a2f8238b93d6d9cbc3890f0af088e2bf1b7 (patch) | |
tree | 4828839494817e4853b8286f51f194ab1d6d2bb0 /share/misc/committers-src.dot | |
parent | 501a76d1371658899cc866079b41c579cf4e0a69 (diff) | |
download | FreeBSD-src-528a6a2f8238b93d6d9cbc3890f0af088e2bf1b7.zip FreeBSD-src-528a6a2f8238b93d6d9cbc3890f0af088e2bf1b7.tar.gz |
Fix inconsistent locking of the swap pager named objects list.
Right now, all modifications of the list are locked by sw_alloc_mtx.
But initial lookup of the object by the handle in swap_pager_alloc()
is not protected by sw_alloc_mtx, which means that
vm_pager_object_lookup() could follow freed pointer.
Create a new named swap object with the OBJT_SWAP type, instead
of OBJT_DEFAULT. With this change, swp_pager_meta_build() never need
to upgrade named OBJT_DEFAULT to OBJT_SWAP (in the other place, we do
not forbid for client code to create named OBJT_DEFAULT objects at
all).
That change allows to remove sw_alloc_mtx and make the list locked by
sw_alloc_sx lock. Update swap_pager_copy() to new locking mode.
Create helper swap_pager_alloc_init() to consolidate named and
anonymous swap objects creation, while a caller ensures that the
neccesary locks are held around the helper.
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Approved by: re (hrs)
Diffstat (limited to 'share/misc/committers-src.dot')
0 files changed, 0 insertions, 0 deletions