Skip to content

services/pipewire: avoid use-after-free in PwDefaultTracker::reset()#567

Open
bbedward wants to merge 2 commits intoquickshell-mirror:masterfrom
bbedward:pw-use-after-free
Open

services/pipewire: avoid use-after-free in PwDefaultTracker::reset()#567
bbedward wants to merge 2 commits intoquickshell-mirror:masterfrom
bbedward:pw-use-after-free

Conversation

@bbedward
Copy link
Contributor

relevant to #534

onFatalError() is queued, so by the time reset() runs the PwNode objects may already be destroyed. The setter
functions go through setSimpleObjectHandleQObject::disconnect() on dangling pointers → SIGSEGV.

This changes to directly null the pointers and emit signals in reset(), skipping the disconnect-from-dead-objects path.

@outfoxxed
Copy link
Member

Shouldn't this already be handled by the QObject::destroyed connection in SimpleObjectHandle? (I am not particularly proud of that interface, which should probably be replaced by bindables, but it should theoretically work for this)

@bbedward
Copy link
Contributor Author

You're right but somehow something causes mDefaultSink to point to freed memory in these crashes, but I dont see a case off hand why the destroyed signal wouldnt work - I'll look more into it.

…g SimpleObjectHandle with per-handle connections
@bbedward
Copy link
Contributor Author

Alternative fix pushed with per-handle connections, should still fix the crash - which I believe is caused by the nodes sharing the same destroyed slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments