]> git.proxmox.com Git - mirror_zfs.git/commit
dmu_objset_userquota_get_ids uses dn_bonus unsafely
authorNed Bass <bass6@llnl.gov>
Thu, 28 May 2015 23:14:19 +0000 (16:14 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Jun 2015 19:41:17 +0000 (12:41 -0700)
commit5f8e1e850522ee5cd37366427da4b4101a71c8a8
treee2d658d906c9287d008bc769ca7321e521d93f19
parentd617648c7fc6904261f3ae8f2e3726c5c1838508
dmu_objset_userquota_get_ids uses dn_bonus unsafely

The function dmu_objset_userquota_get_ids() checks and uses dn->dn_bonus
outside of dn_struct_rwlock. If the dnode is being freed then the bonus
dbuf may be in the process of getting evicted. In this case there is a
race that may cause dmu_objset_userquota_get_ids() to access the dbuf
after it has been destroyed. To prevent this, ensure that when we are
using the bonus dbuf we are either holding a reference on it or have
taken dn_struct_rwlock.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3443
module/zfs/dmu_objset.c