All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 01/10] xf86drm: drmGetDevice2: error out if the fd has unknown subsys
@ 2018-06-25 17:36 Emil Velikov
  2018-06-25 17:36 ` [PATCH libdrm 02/10] xf86drm: introduce drm_device_has_rdev() helper Emil Velikov
                   ` (10 more replies)
  0 siblings, 11 replies; 31+ messages in thread
From: Emil Velikov @ 2018-06-25 17:36 UTC (permalink / raw)
  To: dri-devel; +Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

Currently one can open() any /dev node. If it's unknown
drmParseSubsystemType() will return an error.

Track that and bail as needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xf86drm.c b/xf86drm.c
index 87c216cf..e1bbbe99 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3814,6 +3814,8 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
         return -EINVAL;
 
     subsystem_type = drmParseSubsystemType(maj, min);
+    if (subsystem_type < 0)
+        return subsystem_type;
 
     local_devices = calloc(max_count, sizeof(drmDevicePtr));
     if (local_devices == NULL)
-- 
2.18.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2018-06-29 15:49 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 17:36 [PATCH libdrm 01/10] xf86drm: drmGetDevice2: error out if the fd has unknown subsys Emil Velikov
2018-06-25 17:36 ` [PATCH libdrm 02/10] xf86drm: introduce drm_device_has_rdev() helper Emil Velikov
2018-06-28 10:14   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 03/10] xf86drm: Fold drmDevice processing into process_device() helper Emil Velikov
2018-06-28 11:50   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 04/10] xf86drm: Allocate drmDevicePtr's on stack Emil Velikov
2018-06-28 12:52   ` Robert Foss
2018-06-28 17:07     ` Emil Velikov
2018-06-29 15:20   ` [PATCH libdrm v2 " Emil Velikov
2018-06-29 15:49     ` Robert Foss
2018-06-29 15:22   ` [PATCH libdrm v2 05/10] xf86drm: introduce a get_real_pci_path() helper Emil Velikov
2018-06-25 17:36 ` [PATCH libdrm " Emil Velikov
2018-06-28 10:21   ` Eric Engestrom
2018-06-28 10:23     ` Eric Engestrom
2018-06-28 16:42     ` Emil Velikov
2018-06-28 16:06   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 06/10] xf86drm: Add drmDevice support for virtio_gpu Emil Velikov
2018-06-28 16:08   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 07/10] tests/drmdevices: install alongside other utilities Emil Velikov
2018-06-28 16:09   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 08/10] tests/drmdevice: add a couple of printf headers Emil Velikov
2018-06-28 16:09   ` Robert Foss
2018-06-25 17:36 ` [PATCH libdrm 09/10] drmdevice: convert the tabbed output into a tree Emil Velikov
2018-06-28 10:19   ` Eric Engestrom
2018-06-28 16:43     ` Emil Velikov
2018-06-28 16:09   ` Robert Foss
2018-06-29 15:24   ` [PATCH libdrm v2 " Emil Velikov
2018-06-25 17:36 ` [PATCH libdrm 10/10] drmdevice: print the correct host1x information Emil Velikov
2018-06-28 16:09   ` Robert Foss
2018-06-28 10:11 ` [PATCH libdrm 01/10] xf86drm: drmGetDevice2: error out if the fd has unknown subsys Robert Foss
2018-06-28 10:11 ` Robert Foss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.