1. 24 12月, 2009 20 次提交
  2. 23 12月, 2009 4 次提交
  3. 17 12月, 2009 1 次提交
  4. 16 12月, 2009 2 次提交
  5. 15 12月, 2009 2 次提交
    • R
      USB: Close usb_find_interface race v3 · c2d284ee
      Russ Dill 提交于
      USB drivers that create character devices call usb_register_dev in their
      probe function. This associates the usb_interface device with that minor
      number and creates the character device and announces it to the world.
      However, the driver's probe function is called before the new
      usb_interface is added to the driver's klist_devices.
      
      This is a problem because userspace will respond to the character device
      creation announcement by opening the character device. The driver's open
      function will the call usb_find_interface to find the usb_interface
      associated with that minor number. usb_find_interface will walk the
      driver's list of devices and find the usb_interface with the matching
      minor number.
      
      Because the announcement happens before the usb_interface is added to the
      driver's klist_devices, a race condition exists. A straightforward fix
      is to walk the list of devices on usb_bus_type instead since the device
      is added to that list before the announcement occurs.
      
      bus_find_device calls get_device to bump the reference count on the found
      device. It is arguable that the reference count should be dropped by the
      caller of usb_find_interface instead of usb_find_interface, however,
      the current users of usb_find_interface do not expect this.
      
      The original version of this patch only matched against minor number
      instead of driver and minor number. This version matches against both.
      Signed-off-by: NRuss Dill <Russ.Dill@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c2d284ee
    • G
      Revert "USB: Close usb_find_interface race" · ab7cd8c7
      Greg Kroah-Hartman 提交于
      This reverts commit a2582bd4.
      
      It turned out to be buggy and broke USB printers from working.
      
      Cc: Russ Dill <Russ.Dill@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ab7cd8c7
  6. 14 12月, 2009 2 次提交
  7. 12 12月, 2009 9 次提交