xserver: Branch 'master' - 2 commits
Adam Jackson
ajax at kemper.freedesktop.org
Mon May 21 17:57:36 UTC 2018
hw/xfree86/drivers/modesetting/driver.c | 6 +++---
hw/xfree86/os-support/linux/lnx_platform.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 315c63c41d833700c505e4f21ffac4c59e1e3b2c
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri May 18 11:23:01 2018 +0200
modesetting: Pass O_CLOEXEC when opening a DRM device
We don't want DRM file descriptors to leak to child processes.
Reviewed-by: Keith Packard <keithp at keithp.com>
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 5d8906d63..306541f33 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -200,12 +200,12 @@ open_hw(const char *dev)
int fd;
if (dev)
- fd = open(dev, O_RDWR, 0);
+ fd = open(dev, O_RDWR | O_CLOEXEC, 0);
else {
dev = getenv("KMSDEVICE");
- if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) {
+ if ((NULL == dev) || ((fd = open(dev, O_RDWR | O_CLOEXEC, 0)) == -1)) {
dev = "/dev/dri/card0";
- fd = open(dev, O_RDWR, 0);
+ fd = open(dev, O_RDWR | O_CLOEXEC, 0);
}
}
if (fd == -1)
commit ab53e2859facecc0486344679dc01ea31fb427e9
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri May 18 11:23:00 2018 +0200
xfree86: Fix O_CLOEXEC usage in lnx_platform
It was passing O_CLOEXEC as permission bits instead of as a flag.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 11af52c46..70374ace8 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -43,7 +43,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
}
if (fd == -1)
- fd = open(path, O_RDWR, O_CLOEXEC);
+ fd = open(path, O_RDWR | O_CLOEXEC, 0);
if (fd == -1)
return FALSE;
More information about the xorg-commit
mailing list