diff --git a/U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch b/U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch new file mode 100644 index 0000000..7876c74 --- /dev/null +++ b/U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch @@ -0,0 +1,37 @@ +From: Dave Airlie +Date: Fri Apr 29 14:01:31 2016 +1000 +Subject: [PATCH]modesetting: set driverPrivate to NULL after closing fd. +Patch-mainline: Upstream +Git-repo: git://anongit.freedesktop.org/git/xorg/xserver +Git-commit: a41a171bcbae9aeafac2865faa904f15d9b59925 +References: boo#981268 +Signed-off-by: Egbert Eich + +Otherwise ms_ent_priv will return NULL and things will fall apart. + +Reviewed-by: Alex Deucher +Signed-off-by: Dave Airlie +--- + hw/xfree86/drivers/modesetting/driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c +index c97f33a..abf7e1a 100644 +--- a/hw/xfree86/drivers/modesetting/driver.c ++++ b/hw/xfree86/drivers/modesetting/driver.c +@@ -635,7 +635,6 @@ FreeRec(ScrnInfoPtr pScrn) + ms = modesettingPTR(pScrn); + if (!ms) + return; +- pScrn->driverPrivate = NULL; + + if (ms->fd > 0) { + modesettingEntPtr ms_ent; +@@ -656,6 +655,7 @@ FreeRec(ScrnInfoPtr pScrn) + ms_ent->fd = 0; + } + } ++ pScrn->driverPrivate = NULL; + free(ms->drmmode.Options); + free(ms); + diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index b4da6b8..1f0b7a5 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue May 24 06:20:16 UTC 2016 - eich@suse.com + +- U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch: + modesetting: Avoid crash in FreeRec() by NULLing a pointer which + may still be used (boo#981268). + ------------------------------------------------------------------- Mon May 16 19:53:50 UTC 2016 - eich@suse.com diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index dff004f..92f8fa0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -216,6 +216,7 @@ Patch1228: U_ephyr-enable-option-sw-cursor-by-default-in-multi-se.patch Patch1229: U_kdrive-introduce-input-hot-plugging-support-for-udev.patch Patch1230: U_kdrive-add-options-to-set-default-XKB-properties.patch Patch1232: U_config-udev-distinguish-between-real-keyboards-and-o.patch +Patch1233: U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch %description This package contains the X.Org Server. @@ -356,6 +357,7 @@ sh %{SOURCE92} --verify . %{SOURCE91} %patch1230 -p1 %patch1232 -p1 +%patch1233 -p1 %build test -e source-file-list || \