mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-14 14:32:57 -04:00
Merge branch 'fix/use-after-free-dmabuf-name' into 'master'
types/linux_dmabuf: fix use-after-free of device node name See merge request wlroots/wlroots!5398
This commit is contained in:
commit
88efaa1aa6
1 changed files with 2 additions and 2 deletions
|
|
@ -901,9 +901,9 @@ static bool set_default_feedback(struct wlr_linux_dmabuf_v1 *linux_dmabuf,
|
||||||
if (device->available_nodes & (1 << DRM_NODE_RENDER)) {
|
if (device->available_nodes & (1 << DRM_NODE_RENDER)) {
|
||||||
const char *name = device->nodes[DRM_NODE_RENDER];
|
const char *name = device->nodes[DRM_NODE_RENDER];
|
||||||
main_device_fd = open(name, O_RDWR | O_CLOEXEC);
|
main_device_fd = open(name, O_RDWR | O_CLOEXEC);
|
||||||
drmFreeDevice(&device);
|
|
||||||
if (main_device_fd < 0) {
|
if (main_device_fd < 0) {
|
||||||
wlr_log_errno(WLR_ERROR, "Failed to open DRM device %s", name);
|
wlr_log_errno(WLR_ERROR, "Failed to open DRM device %s", name);
|
||||||
|
drmFreeDevice(&device);
|
||||||
goto error_compiled;
|
goto error_compiled;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -913,8 +913,8 @@ static bool set_default_feedback(struct wlr_linux_dmabuf_v1 *linux_dmabuf,
|
||||||
assert(device->available_nodes & (1 << DRM_NODE_PRIMARY));
|
assert(device->available_nodes & (1 << DRM_NODE_PRIMARY));
|
||||||
wlr_log(WLR_DEBUG, "DRM device %s has no render node, "
|
wlr_log(WLR_DEBUG, "DRM device %s has no render node, "
|
||||||
"skipping DMA-BUF import checks", device->nodes[DRM_NODE_PRIMARY]);
|
"skipping DMA-BUF import checks", device->nodes[DRM_NODE_PRIMARY]);
|
||||||
drmFreeDevice(&device);
|
|
||||||
}
|
}
|
||||||
|
drmFreeDevice(&device);
|
||||||
|
|
||||||
size_t tranches_len =
|
size_t tranches_len =
|
||||||
feedback->tranches.size / sizeof(struct wlr_linux_dmabuf_feedback_v1_tranche);
|
feedback->tranches.size / sizeof(struct wlr_linux_dmabuf_feedback_v1_tranche);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue