Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

backend/drm: fix segfault in init_drm_surface #1944

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

emersion
Copy link
Member

@emersion emersion commented Dec 5, 2019

When surf->gbm was previously set, we destroy it without setting it to
NULL. Later on, we only create the GBM surface if surf->gbm is NULL.
This result in a use-after-free when we start using surf->gbm.

Closes: #1868
Closes: #1874
Closes: swaywm/sway#4785
Closes: swaywm/sway#4717
Closes: swaywm/sway#4730
Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")

When surf->gbm was previously set, we destroy it without setting it to
NULL. Later on, we only create the GBM surface if surf->gbm is NULL.
This result in a use-after-free when we start using surf->gbm.

Closes: swaywm#1868
Closes: swaywm#1874
Closes: swaywm/sway#4785
Closes: swaywm/sway#4717
Closes: swaywm/sway#4730
Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
@ddevault ddevault merged commit 6ca8208 into swaywm:master Dec 5, 2019
@ddevault
Copy link
Contributor

ddevault commented Dec 5, 2019

Badass. Thanks!

@emersion emersion deleted the fix-init-drm-surfcae-segfault branch December 5, 2019 15:51
@agx
Copy link
Contributor

agx commented Dec 5, 2019

this looks like a fix for a crash i've also been seeing, great!

@Vorsplummi
Copy link

I can change the resolution on my secondary monitor without crashing now. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
5 participants