[kernel] r15875 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Tue Jun 15 01:44:13 UTC 2010


Author: benh
Date: Tue Jun 15 01:44:11 2010
New Revision: 15875

Log:
usbhid: Reduce the race condition between disconnect and ioctl (Closes: #511892)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/usbhid-Reduce-race-between-disconnect-ioctl.patch
   dists/lenny/linux-2.6/debian/patches/series/24
Modified:
   dists/lenny/linux-2.6/debian/changelog

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Tue Jun 15 00:26:28 2010	(r15874)
+++ dists/lenny/linux-2.6/debian/changelog	Tue Jun 15 01:44:11 2010	(r15875)
@@ -1,3 +1,11 @@
+linux-2.6 (2.6.26-24) UNRELEASED; urgency=low
+
+  [ Ben Hutchings ]
+  * usbhid: Reduce the race condition between disconnect and ioctl
+    (Closes: #511892)
+
+ -- Ben Hutchings <ben at decadent.org.uk>  Tue, 15 Jun 2010 02:41:50 +0100
+
 linux-2.6 (2.6.26-23) stable; urgency=high
 
   [ dann frazier ]

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/usbhid-Reduce-race-between-disconnect-ioctl.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/usbhid-Reduce-race-between-disconnect-ioctl.patch	Tue Jun 15 01:44:11 2010	(r15875)
@@ -0,0 +1,37 @@
+From 407a38aeb24be9fe76815c6d0dbb236b7a242d51 Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Tue, 15 Jun 2010 02:35:06 +0100
+Subject: [PATCH] usbhid: Reduce the race condition between disconnect and ioctl
+
+hiddev_ioctl() always looks up the parent USB device, which may go
+away even before exist is set to false.  Reduce the race condition by
+only looking up the parent device when needed, i.e. for
+HIDIOCGDEVINFO.  This should fix bug #511892.
+---
+ drivers/hid/usbhid/hiddev.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
+index 95cc192..26ee39b 100644
+--- a/drivers/hid/usbhid/hiddev.c
++++ b/drivers/hid/usbhid/hiddev.c
+@@ -545,7 +545,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
+ 	struct hiddev_list *list = file->private_data;
+ 	struct hiddev *hiddev = list->hiddev;
+ 	struct hid_device *hid = hiddev->hid;
+-	struct usb_device *dev = hid_to_usb_dev(hid);
++	struct usb_device *dev;
+ 	struct hiddev_collection_info cinfo;
+ 	struct hiddev_report_info rinfo;
+ 	struct hiddev_field_info finfo;
+@@ -579,6 +579,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
+ 		return hid->collection[i].usage;
+ 
+ 	case HIDIOCGDEVINFO:
++		dev = hid_to_usb_dev(hid);
+ 		dinfo.bustype = BUS_USB;
+ 		dinfo.busnum = dev->bus->busnum;
+ 		dinfo.devnum = dev->devnum;
+-- 
+1.7.1
+

Added: dists/lenny/linux-2.6/debian/patches/series/24
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/series/24	Tue Jun 15 01:44:11 2010	(r15875)
@@ -0,0 +1 @@
++ bugfix/all/usbhid-Reduce-race-between-disconnect-ioctl.patch



More information about the Kernel-svn-changes mailing list