Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend/drm: fix segfault in init_drm_surface #1944

Merged
merged 1 commit into from Dec 5, 2019

Conversation

@emersion
Copy link
Member

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: #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")
@Emantor
Emantor approved these changes Dec 5, 2019
@ddevault ddevault merged commit 6ca8208 into swaywm:master Dec 5, 2019
3 checks passed
3 checks passed
builds.sr.ht: alpine.yml builds.sr.ht job completed successfully
Details
builds.sr.ht: archlinux.yml builds.sr.ht job completed successfully
Details
builds.sr.ht: freebsd.yml builds.sr.ht job completed successfully
Details
@ddevault

This comment has been minimized.

Copy link
Member

ddevault commented Dec 5, 2019

Badass. Thanks!

@emersion emersion deleted the emersion:fix-init-drm-surfcae-segfault branch Dec 5, 2019
@agx

This comment has been minimized.

Copy link
Contributor

agx commented Dec 5, 2019

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

@Vorsplummi

This comment has been minimized.

Copy link

Vorsplummi commented Dec 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.