]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid dereferencing potentially freed workitem in
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 21 Aug 2017 16:23:44 +0000 (16:23 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 21 Aug 2017 16:23:44 +0000 (16:23 +0000)
commitf0d5223230714716a53dc0a1a59fc72f821a5c7d
treed13cbc6a5d49e93c7f1a25539a71c6ccf7d7048d
parentb5f2560d099176a00e9b9835e031b1742edf96fb
Avoid dereferencing potentially freed workitem in
softdep_count_dependencies().

Buffer's b_dep list is protected by the SU mount lock.  Owning the
buffer lock is not enough to guarantee the stability of the list.

Calculation of the UFS mount owning the workitems from the buffer must
be much more careful to not dereference the work item which might be
freed meantime.  To get to ump, use the pointers chain which does not
involve workitems at all.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
sys/ufs/ffs/ffs_softdep.c