summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-12-18 12:26:20 +1000
committerJosé Expósito <jose.exposito89@gmail.com>2024-01-16 09:24:01 +0100
commit219c54b8a3337456ce5270ded6a67bcde53553d5 (patch)
treec3f4fce55eb59cc6157ebc2310582c09e69d6e7a /Xi
parentece23be888a93b741aa1209d1dbf64636109d6a5 (diff)
dix: fix DeviceStateNotify event calculation
The previous code only made sense if one considers buttons and keys to be mutually exclusive on a device. That is not necessarily true, causing a number of issues. This function allocates and fills in the number of xEvents we need to send the device state down the wire. This is split across multiple 32-byte devices including one deviceStateNotify event and optional deviceKeyStateNotify, deviceButtonStateNotify and (possibly multiple) deviceValuator events. The previous behavior would instead compose a sequence of [state, buttonstate, state, keystate, valuator...]. This is not protocol correct, and on top of that made the code extremely convoluted. Fix this by streamlining: add both button and key into the deviceStateNotify and then append the key state and button state, followed by the valuators. Finally, the deviceValuator events contain up to 6 valuators per event but we only ever sent through 3 at a time. Let's double that troughput. CVE-2024-0229, ZDI-CAN-22678 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Diffstat (limited to 'Xi')
0 files changed, 0 insertions, 0 deletions