diff -u xorg-server-21.1.4/debian/changelog xorg-server-21.1.4/debian/changelog --- xorg-server-21.1.4/debian/changelog +++ xorg-server-21.1.4/debian/changelog @@ -1,3 +1,10 @@ +xorg-server (2:21.1.4-2ubuntu1.6) kinetic; urgency=medium + + * debian/patches/force-update-leds-after-enable-device.patch: + Force update keyboard LEDs after switching VT to X session (LP: #1993621). + + -- Yao Wei (魏銘廷) Tue, 21 Feb 2023 06:34:27 +0000 + xorg-server (2:21.1.4-2ubuntu1.5) kinetic-security; urgency=medium * SECURITY UPDATE: DeepCopyPointerClasses use-after-free diff -u xorg-server-21.1.4/debian/patches/series xorg-server-21.1.4/debian/patches/series --- xorg-server-21.1.4/debian/patches/series +++ xorg-server-21.1.4/debian/patches/series @@ -36,3 +36,4 @@ CVE-2022-46344-2.patch CVE-2022-4283.patch CVE-2023-0494.patch +force-update-leds-after-enable-device.patch only in patch2: unchanged: --- xorg-server-21.1.4.orig/debian/patches/force-update-leds-after-enable-device.patch +++ xorg-server-21.1.4/debian/patches/force-update-leds-after-enable-device.patch @@ -0,0 +1,89 @@ +Origin: https://gitlab.freedesktop.org/xorg/xserver/-/commit/7ce57e179b257f35e447971f4fb6614e3360762a +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1993621 +Applied-Upstream: yes +From: Yao Wei +Date: Tue, 21 Feb 2023 03:43:05 +0000 +Subject: [PATCH] dix: Force update LEDs after device state update in EnableDevice + +This is to make sure the hardware gets the device states regardless +whether the internal state has changed or not, to overcome situations +that device LEDs are out of sync e.g. switching between VTs. + +Signed-off-by: Yao Wei (魏銘廷) +--- + dix/devices.c | 4 ++++ + include/xkbsrv.h | 2 ++ + xkb/xkbLEDs.c | 38 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 44 insertions(+) + +--- a/dix/devices.c ++++ b/dix/devices.c +@@ -422,6 +422,10 @@ + + if (!IsMaster(dev) && !IsFloating(dev)) + XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0); ++ ++ /* Now make sure our LEDs are in sync with the locked state */ ++ XkbForceUpdateDeviceLEDs(dev); ++ + RecalculateMasterButtons(dev); + + /* initialise an idle timer for this device*/ +--- a/include/xkbsrv.h ++++ b/include/xkbsrv.h +@@ -505,6 +505,8 @@ + XkbEventCausePtr /* cause */ + ); + ++extern void XkbForceUpdateDeviceLEDs(DeviceIntPtr /* keybd */); ++ + extern _X_EXPORT void XkbUpdateAllDeviceIndicators(XkbChangesPtr /* changes */, + XkbEventCausePtr /* cause */ + ); +--- a/xkb/xkbLEDs.c ++++ b/xkb/xkbLEDs.c +@@ -435,6 +435,44 @@ + + /***====================================================================***/ + ++ /* ++ * void ++ * XkbForceUpdateDeviceLEDs(DeviceIntPtr dev) ++ * ++ * Force update LED states to the hardware from the device state ++ * specified by 'dev'. ++ * ++ * If 'dev' is a master device, this function will also force update ++ * its slave devices. ++ * ++ * Used if the actual LED state was externally set and need to push ++ * current state to the hardware e.g. switching between VTs. ++ */ ++ ++void ++XkbForceUpdateDeviceLEDs(DeviceIntPtr dev) ++{ ++ DeviceIntPtr master; ++ XkbSrvLedInfoPtr sli; ++ ++ if (!dev->key) ++ return; ++ ++ sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); ++ XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState); ++ ++ if (IsMaster(dev)) { ++ master = dev; ++ nt_list_for_each_entry(dev, inputInfo.devices, next) { ++ if (!dev->key || GetMaster(dev, MASTER_KEYBOARD) != master) ++ continue; ++ ++ sli = XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, 0); ++ XkbDDXUpdateDeviceIndicators(dev, sli, sli->effectiveState); ++ } ++ } ++} ++ + /***====================================================================***/ + + /*