mirror of
https://github.com/X11Libre/xserver.git
synced 2026-12-01 08:00:28 +00:00
Xi: fix NULL pointer dereference in ProcXQueryDeviceState
The handler deliberately continues when dixLookupDevice() returns BadAccess (to emit class headers with the device state blanked out). However dixLookupDevice() leaves *pDev == NULL on any non-Success return, so the subsequent "v = dev->valuator" dereferenced NULL and crashed the server. This is reachable when an XACE/SELinux hook denies the client's DixReadAccess to the device. Bail out when dev is NULL instead of dereferencing it. Fixes:8502c06e19("xace: Fake return values on denials in input polling requests.") Fixes:5c03d13181("xace: add new hooks + access controls: XInput extension.") Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
c8c2f741ad
commit
c69b2ea141
1 changed files with 7 additions and 0 deletions
|
|
@ -76,6 +76,13 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
if (rc != Success && rc != BadAccess)
|
||||
return rc;
|
||||
|
||||
/* dixLookupDevice() leaves dev NULL on anything other than Success,
|
||||
* including BadAccess. The code below intentionally continues on
|
||||
* BadAccess to blank out the state, but it cannot do so without a valid
|
||||
* device, so bail out rather than dereferencing NULL. */
|
||||
if (!dev)
|
||||
return rc;
|
||||
|
||||
v = dev->valuator;
|
||||
if (v != NULL && v->motionHintWindow != NULL)
|
||||
MaybeStopDeviceHint(dev, client);
|
||||
|
|
|
|||
Loading…
Reference in a new issue