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 243c439
Browse filesBrowse the repository at this point in the historyBrowse files
feat(pool): pooled-buffer view-in-a-field dangle — Memory view of an IMemoryOwner field read after Dispose → OWN002
Generalises the field-mediated use-after-dispose pass (#75/#76) to POOLED owners
and their Memory views. An `IMemoryOwner<T>` field released in `Dispose()` is a
released owner, and a `Memory`/`ReadOnlyMemory` field assigned `_owner.Memory`
(recognised by ViewOwner, which returns the owner name for a bare-field receiver)
is recorded as a VIEW of that owner. A read of the view field — or of the owner
directly — in a live subscription-target handler (directly or one hop through a
private helper), with no `if (_disposed) return;` guard before it, is lowered to a
synthetic acquire/release/use flow on the owner → OWN002. The view-field aliases
the owner, so reading it after the owner's release is a use of the owner after
release.
New `ReleasedOwner(field)` unifies the two: the field itself when it is a released
owner, or the owner it aliases when it is a view field. `FirstUnguardedDisposedRead`
and the handler trigger loop both route through it, so direct disposed-field reads
(#75/#76) are unchanged and view-field reads are additive.
Precision: same handler reachability that makes the disposed-field UAF sound (a
live handler can fire after Dispose). The owner must be released in the dispose
lifecycle; the view→owner alias is symbol-resolved (`IMemoryOwner<T>.Memory`); a
guarded/unsubscribed handler never fires. Exposing such a view via a public getter
is deliberately NOT flagged — `IMemoryOwner.Memory` is itself a valid
"valid-until-Dispose" pattern, so only a provably-post-release read is a bug.
New corpus case corpus/wpf/pooled-view-after-dispose (before → OWN002, guarded
after → silent). Benchmark recall floor 22 -> 23. Scope: IMemoryOwner owner +
member-access view read; ArrayPool byte[]-buffer-field views, bare-arg reads, and
element-access reads are honest follow-ups. Python suite + metamorphic green; C#
validated by CI.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
0 commit comments