Summary: | [CVE-2013-1940] VT-switched servers receive input from hot-plugged devices | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Peter Hutterer <peter.hutterer> | ||||
Component: | Server/DDX/Xorg | Assignee: | Peter Hutterer <peter.hutterer> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | medium | CC: | huzaifas, marcoz, peter.hutterer, xorg_security | ||||
Version: | git | ||||||
Hardware: | Other | ||||||
OS: | Linux (All) | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Peter Hutterer
2013-04-10 04:52:47 UTC
Created attachment 77717 [details] [review] patch to fix flush input This fixes the input flush code to use a larger buffer size so we can drain evdev events. Correction, the interpretation of the cause was wrong. The server _does_ check whether it is the VT owner and does not enable the device. So this part of the server is correct. The events are sent after VT-switching back because they're still on the fd. When the next event comes on that fd, the driver reads all events off the wire and thus processes the ones from before vt-switching back too. The evdev driver does call xf86FlushInput() to ditch these events, but xf86FlushInput() is the real bug: it reads 4 bytes off the fd until there is none left. The kernel will not write into a buffer smaller than sizeof(struct input_event), the events aren't discarded and show up with the next input from that device. This is most likely a Linux only problem. This only happens with the evdev driver. evdev keeps the fd open between PreInit and DEVICE_ON, which is how these events accumulate in the first place. other drivers open and close the fd in PreInit and then re-open it for DEVICE_ON. A quick git log shows this behaviour has been there since at least evdev 2.0. Comment on attachment 77717 [details] [review] patch to fix flush input Review of attachment 77717 [details] [review]: ----------------------------------------------------------------- Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> CC-ing stable branch maintainer Embargo date 17 April This issue is public now. http://bugzilla.redhat.com/CVE-2013-1940 commit 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f Author: Dave Airlie <airlied@gmail.com> Date: Wed Apr 10 16:09:01 2013 +1000 xf86: fix flush input to work with Linux evdev devices. xorg-server-1.13.4 and xorg-server-1.14.1 have been released with the fixes for this issue. No additional stable releases are planned at this point, users relying on 1.12 or earlier servers will have to apply the patch themselves. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.