Page MenuHomeFreeBSD

2/3 vfs: fix device count leak on vrele racing with vgone
ClosedPublic

Authored by mjg on Feb 6 2020, 12:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:41 AM
Unknown Object (File)
Oct 26 2023, 8:39 PM
Unknown Object (File)
Aug 13 2023, 6:29 AM
Unknown Object (File)
Aug 2 2023, 6:22 PM
Unknown Object (File)
May 17 2023, 6:21 PM
Subscribers

Details

Summary

The race is:

CPU1                                        CPU2
                                    devfs_reclaim_vchr
make v_usecount 0
                                      VI_LOCK
                                      sees v_usecount == 0, no updates
                                      vp->v_rdev = NULL;
                                      ...
                                      VI_UNLOCK
VI_LOCK
v_decr_devcount
  sees v_rdev == NULL, no updates

In this scenario si_devcount decrement is not performed.

Note this can only happen if the vnode lock is not held.

Also see the 3/3 review.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable