You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9d6ffbf
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix use-after-free of a blackboard entry held by getAnyLocked (alternative to #1181) (#1202)
* fix use-after-free of a blackboard entry held by getAnyLocked
AnyPtrLocked holds raw pointers into a Blackboard::Entry and can not own it
without changing its layout (ABI). Attach a custom deleter to every Entry at
its two allocation sites: an entry whose last shared_ptr is dropped while its
mutex is still locked is parked, and destroyed by a later retirement that
finds it unlocked.
Being attached at allocation time, the deleter covers unset(), clear(),
cloneInto() and ~Blackboard with no change to them, including the unset()
already inlined in binaries built against the 4.10 headers. No header change.
Alternative to #1181; the AnyPtrLocked* regression tests come from that PR.
Co-Authored-By: Aysha Afrah Ziya <aysha26@digiscrypt.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* blackboard entry deleter: noexcept fast path, destroy values outside the storage lock
Changes requested by two independent reviews:
- RetireEntry is noexcept, and neither locks nor allocates when nothing is parked
- unset(), clear() and cloneInto() destroy the removed values after releasing
storage_mutex_
- parked entries are also swept when a new entry is created, to bound the
delay of the stored value's destructor
- document that LockedPtr is not valid after unlock()
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Aysha Afrah Ziya <aysha26@digiscrypt.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
0 commit comments