summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2013-04-10 16:09:01 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-04-17 15:46:03 +1000
commit8039b6b7a31f6cf75fcbe4e472d8e9544808396c (patch)
tree46e826308a70b466b27fcb10525038098f16b4b1
parent87d7e3e3525a9bcfa08d64ee2a83341e19140db7 (diff)
xf86: fix flush input to work with Linux evdev devices.
So when we VT switch back and attempt to flush the input devices, we don't succeed because evdev won't return part of an event, since we were only asking for 4 bytes, we'd only get -EINVAL back. This could later cause events to be flushed that we shouldn't have gotten. This is a fix for CVE-2013-1940. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f)
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index ab3757a2a..4d08c1e85 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -421,7 +421,8 @@ xf86FlushInput(int fd)
{
fd_set fds;
struct timeval timeout;
- char c[4];
+ /* this needs to be big enough to flush an evdev event. */
+ char c[256];
DebugF("FlushingSerial\n");
if (tcflush(fd, TCIFLUSH) == 0)