diff options
| -rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2022-49737.patch | 90 | ||||
| -rw-r--r-- | meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb | 1 |
2 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2022-49737.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2022-49737.patch new file mode 100644 index 0000000000..86c9f59f8c --- /dev/null +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/CVE-2022-49737.patch | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | From dc7cb45482cea6ccec22d117ca0b489500b4d0a0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: tholin <thomas.lindroth@gmail.com> | ||
| 3 | Date: Tue, 4 Jan 2022 12:08:11 +0000 | ||
| 4 | Subject: [PATCH] dix: Hold input lock for AttachDevice() | ||
| 5 | |||
| 6 | Fix the following race: | ||
| 7 | |||
| 8 | Possible data race during read of size 8 at 0xA112510 by thread #6 | ||
| 9 | Locks held: 1, at address 0x366B40 | ||
| 10 | at 0x14C8B9: GetMaster (devices.c:2691) | ||
| 11 | by 0x15CFC5: IsFloating (events.c:346) | ||
| 12 | by 0x2B9554: miPointerGetScreen (mipointer.c:527) | ||
| 13 | by 0x1A5136: xf86PostButtonEventM (xf86Xinput.c:1379) | ||
| 14 | by 0x1A52BD: xf86PostButtonEvent (xf86Xinput.c:1345) | ||
| 15 | by 0x485F45B: EvdevProcessEvent (in /usr/lib64/xorg/modules/input/evdev_drv.so) | ||
| 16 | by 0x485FDAC: EvdevReadInput (in /usr/lib64/xorg/modules/input/evdev_drv.so) | ||
| 17 | by 0x195427: xf86ReadInput (xf86Events.c:247) | ||
| 18 | by 0x2CC113: InputReady (inputthread.c:180) | ||
| 19 | by 0x2CE4EA: ospoll_wait (ospoll.c:657) | ||
| 20 | by 0x2CC077: InputThreadDoWork (inputthread.c:369) | ||
| 21 | by 0x484A336: mythread_wrapper (hg_intercepts.c:406) | ||
| 22 | |||
| 23 | This conflicts with a previous write of size 8 by thread #1 | ||
| 24 | Locks held: none | ||
| 25 | at 0x14D2C6: AttachDevice (devices.c:2609) | ||
| 26 | by 0x15CF85: ReattachToOldMaster (events.c:1457) | ||
| 27 | by 0x1647DD: DeactivateKeyboardGrab (events.c:1700) | ||
| 28 | by 0x25D7F1: ProcXIUngrabDevice (xigrabdev.c:169) | ||
| 29 | by 0x2552AD: ProcIDispatch (extinit.c:398) | ||
| 30 | by 0x155291: Dispatch (dispatch.c:479) | ||
| 31 | by 0x158CBA: dix_main (main.c:276) | ||
| 32 | by 0x143A3D: main (stubmain.c:34) | ||
| 33 | Address 0xa112510 is 336 bytes inside a block of size 904 alloc'd | ||
| 34 | at 0x4846571: calloc (vg_replace_malloc.c:1328) | ||
| 35 | by 0x14A0B3: AddInputDevice (devices.c:260) | ||
| 36 | by 0x1A31A0: xf86ActivateDevice (xf86Xinput.c:365) | ||
| 37 | by 0x1A4549: xf86NewInputDevice (xf86Xinput.c:948) | ||
| 38 | by 0x1A4B44: NewInputDeviceRequest (xf86Xinput.c:1090) | ||
| 39 | by 0x1B81FE: device_added (udev.c:282) | ||
| 40 | by 0x1B8516: config_udev_init (udev.c:439) | ||
| 41 | by 0x1B7091: config_init (config.c:50) | ||
| 42 | by 0x197970: InitInput (xf86Init.c:814) | ||
| 43 | by 0x158C6B: dix_main (main.c:250) | ||
| 44 | by 0x143A3D: main (stubmain.c:34) | ||
| 45 | Block was alloc'd by thread #1 | ||
| 46 | |||
| 47 | The steps to trigger the race are: | ||
| 48 | 1. Main thread does cleanup at mipointer.c:360 setting the slave device's | ||
| 49 | miPointerPtr to null. | ||
| 50 | 2. Input thread use MIPOINTER in mipointer.c and get the slave's | ||
| 51 | miPointerPtr = null. | ||
| 52 | 3. Main thread updates dev->master at devices.c:2609. | ||
| 53 | 4. MIPOINTER would now return the master's miPointerPtr but the input | ||
| 54 | thread already got the slave's miPointerPtr in step 2 and segfaults by | ||
| 55 | null ptr deref. | ||
| 56 | |||
| 57 | Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1260 | ||
| 58 | Signed-off-by: Thomas Lindroth <thomas.lindroth@gmail.com> | ||
| 59 | |||
| 60 | CVE: CVE-2022-49737 | ||
| 61 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/dc7cb45482cea6ccec22d117ca0b489500b4d0a0] | ||
| 62 | |||
| 63 | Signed-off-by: Yogita Urade <yogita.urade@windriver.com> | ||
| 64 | --- | ||
| 65 | dix/devices.c | 3 +++ | ||
| 66 | 1 file changed, 3 insertions(+) | ||
| 67 | |||
| 68 | diff --git a/dix/devices.c b/dix/devices.c | ||
| 69 | index 459f1ed..e5a6f02 100644 | ||
| 70 | --- a/dix/devices.c | ||
| 71 | +++ b/dix/devices.c | ||
| 72 | @@ -2671,6 +2671,8 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) | ||
| 73 | if (IsFloating(dev) && !master && dev->enabled) | ||
| 74 | return Success; | ||
| 75 | |||
| 76 | + input_lock(); | ||
| 77 | + | ||
| 78 | /* free the existing sprite. */ | ||
| 79 | if (IsFloating(dev) && dev->spriteInfo->paired == dev) { | ||
| 80 | screen = miPointerGetScreen(dev); | ||
| 81 | @@ -2711,6 +2713,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) | ||
| 82 | RecalculateMasterButtons(master); | ||
| 83 | } | ||
| 84 | |||
| 85 | + input_unlock(); | ||
| 86 | /* XXX: in theory, the MD should change back to its old, original | ||
| 87 | * classes when the last SD is detached. Thanks to the XTEST devices, | ||
| 88 | * we'll always have an SD attached until the MD is removed. | ||
| 89 | -- | ||
| 90 | 2.40.0 | ||
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb index e77b81eed6..6790eb0921 100644 --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.8.bb | |||
| @@ -35,6 +35,7 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat | |||
| 35 | file://CVE-2025-26601-2.patch \ | 35 | file://CVE-2025-26601-2.patch \ |
| 36 | file://CVE-2025-26601-3.patch \ | 36 | file://CVE-2025-26601-3.patch \ |
| 37 | file://CVE-2025-26601-4.patch \ | 37 | file://CVE-2025-26601-4.patch \ |
| 38 | file://CVE-2022-49737.patch \ | ||
| 38 | " | 39 | " |
| 39 | SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152" | 40 | SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152" |
| 40 | 41 | ||
