xserver/config
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Gary T. Giesen ccd005b2e3 config/udev: guard against NULL subsystem in fallback bus id
config_udev_get_fallback_bus_id() passes the result of
udev_device_get_subsystem() straight into strcmp(). That accessor can return
NULL when the device has no subsystem, so strcmp(NULL, "pci") dereferences a
NULL pointer and the server crashes with a SIGSEGV.

The path is reached for any DRM device with no udev ID_PATH property, where
config_udev_odev_setup_attribs() falls back to this function. DisplayLink/evdi
virtual cards have no ID_PATH; a udev remove of such a card during teardown can
present a parent whose subsystem is already gone (reported NULL), and the
unchecked strcmp faults.

The same NULL-subsystem-into-strcmp class was fixed for the four sibling callers
in this file by commit 429ee86a; config_udev_get_fallback_bus_id() was added
later (commit 2f53d1cf) without the guard. The preceding parent==NULL case is
already guarded here; extend the same defensiveness to the subsystem lookup.

Related to: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1905

Signed-off-by: Gary T. Giesen <ggiesen@giesen.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2245>
(cherry picked from commit 9babe7e7f6)
2026-07-02 13:22:41 +02:00
..
config-backends.h config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
config-hal.h config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
config-udev.h config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
config-wscons.h config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
config.c config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
dbus-api Hotplug: D-Bus: API version 2 2007-08-01 01:53:31 +03:00
dbus-core.c os: unexport internal logging functions 2025-06-12 17:21:46 +02:00
dbus-core.h include: move dbus-core.h to config 2024-04-23 01:46:24 +00:00
fdi2iclass.py fdi2iclass: remove unused local variable 2022-04-02 18:06:30 +00:00
hal.c config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
hotplug_priv.h os: unexport SeatId and move it to dix settings 2026-02-03 11:34:14 +01:00
meson.build config: move over nvidia driver quirks to hw/xfree86/compat 2026-02-12 13:25:34 +01:00
udev.c config/udev: guard against NULL subsystem in fallback bus id 2026-07-02 13:22:41 +02:00
wscons.c config: untwist config backend prototypes 2026-06-25 15:30:38 +02:00
x11-input.fdi config: remove mention of AllowEmptyInput 2010-11-11 10:26:44 +10:00