Page MenuHomeFreeBSD

refcount: add missing release fence to refcount_release_if_gt
ClosedPublic

Authored by mjg on Feb 15 2020, 11:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 6:08 AM
Unknown Object (File)
Sep 21 2023, 3:55 AM
Unknown Object (File)
Aug 31 2023, 6:22 AM
Unknown Object (File)
Aug 24 2023, 6:32 PM
Unknown Object (File)
Aug 17 2023, 1:17 AM
Unknown Object (File)
Jul 8 2023, 5:34 PM
Unknown Object (File)
Jul 4 2023, 2:46 AM
Unknown Object (File)
May 14 2023, 6:48 PM
Subscribers

Details

Reviewers
kib
jeff
markj
jhb
Summary

The CPU succeeding in releasing the not last reference can still have pending stores to the object protected by the affected counter. This opens a time window where another CPU can release the last reference and free the object, resulting in use-after-free. On top of that this prevents the compiler from generating more accesses to the object regardless of how atomic_fcmpset_rel_int is implemented (of course as long as it provides the release semantic).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 29411