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)
Sat, Oct 19, 4:56 PM
Unknown Object (File)
Oct 1 2024, 5:40 AM
Unknown Object (File)
Sep 21 2024, 5:01 PM
Unknown Object (File)
Sep 21 2024, 11:16 AM
Unknown Object (File)
Sep 18 2024, 4:18 AM
Unknown Object (File)
Sep 8 2024, 10:14 PM
Unknown Object (File)
Sep 7 2024, 4:55 AM
Unknown Object (File)
Sep 6 2024, 12:05 AM
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