xorg-x11-server/xserver-1.5.0-no-evdev-keyboards-kthnx.patch
Dave Airlie f4653f87d0 * Thu Jun 12 2008 Dave Airlie <airlied@redhat.com> 1.4.99.902-2.20080612
- cve-2008-1377: Record and Security Extension Input validation
- cve-2008-1379: MIT-SHM extension Input Validation flaw
- cve-2008-2360: Render AllocateGlyph extension Integer overflows
- cve-2008-2361: Render CreateCursor extension Integer overflows
- cve-2008-2362: Render Gradient extension Integer overflows
- Rebase to 1.5 head for security patches for above
2008-06-12 06:18:47 +00:00

59 lines
1.5 KiB
Diff

From e654ed62d44b8d61484f97eab1b1adbfb08d375f Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 12 Jun 2008 11:52:29 +1000
Subject: [PATCH] config: disable evdev for keyboards
---
config/hal.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/config/hal.c b/config/hal.c
index f4eb438..ee0f18f 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -168,6 +168,31 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop)
}
#endif
+static Bool
+get_device_is_keyboard(LibHalContext *hal_ctx, const char *udi, DBusError *error_p)
+{
+ char **props;
+ int i;
+ Bool ret = FALSE;
+
+ props = libhal_device_get_property_strlist(hal_ctx, udi,
+ "info.capabilities", error_p);
+ if (!props) {
+ return FALSE;
+ }
+ for (i = 0; props[i]; i++) {
+ if (strcmp(props[i], "input.keys") == 0 ||
+ strcmp(props[i], "input.keyboard") == 0) {
+ ret = TRUE;
+ goto out_error;
+ }
+ }
+
+out_error:
+ libhal_free_string_array(props);
+ return ret;
+}
+
static void
device_added(LibHalContext *hal_ctx, const char *udi)
{
@@ -184,6 +209,9 @@ device_added(LibHalContext *hal_ctx, const char *udi)
dbus_error_init(&error);
+ if (get_device_is_keyboard(hal_ctx, udi, &error))
+ goto unwind;
+
driver = get_prop_string(hal_ctx, udi, "input.x11_driver");
if (!driver){
/* verbose, don't tell the user unless they _want_ to see it */
--
1.5.3.7