Skip to content

slurp: fix use-after-free crash on exit#60751

Open
npmania wants to merge 1 commit into
void-linux:masterfrom
npmania:slurp-frame-callback-uaf
Open

slurp: fix use-after-free crash on exit#60751
npmania wants to merge 1 commit into
void-linux:masterfrom
npmania:slurp-frame-callback-uaf

Conversation

@npmania
Copy link
Copy Markdown

@npmania npmania commented May 25, 2026

Testing the changes

  • I tested the changes in this PR: YES

slurp 1.5.0 has a use-after-free in send_frame(): it overwrites output->frame_callback without destroying the previous wl_surface_frame() callback, so the orphaned callback's listener can fire on a freed output during teardown and crash slurp on exit. Reported and fixed upstream in emersion/slurp@414760a (fixes emersion/slurp#177), which landed after v1.5.0 was tagged, so the current release is affected. The crash is intermittent (depends on whether a frame callback is in flight at exit); for me it hit about half the time.

send_frame() overwrote output->frame_callback without destroying the
previous wl_surface_frame() callback. The orphaned callback's listener
could still fire after its output was freed during teardown, crashing
slurp on exit.

Backport of upstream 414760a (fixes emersion/slurp#177), which landed
after the 1.5.0 release.
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.

Crash when invoked by xdg-desktop-portal

1 participant