• Josef Gajdusek's avatar
    usb: Do not re-read descriptors for wired devices in usb_authorize_device() · e50a322e
    Josef Gajdusek authored
    This patch modifies the usb_authorize_device() function such as that it does
    not reload the device descriptor for wired devices. The reasons for this
    are as follows:
    
    * Some devices dislike the master requesting the descriptor from them twice,
      failing on the usb_get_device_descriptor() call with -ETIMEOUT. Observed this
      on my Pretec 16GB flash drive (4146:ba65).
    
    * Malicious device could send two different descriptors - one before
      authorization, used by userspace to determine whether to authorize it and
      second to be actually used by the kernel when determining which drivers to
      bind.
    Signed-off-by: default avatarJosef Gajdusek <atx@atx.name>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    e50a322e
hub.c 163 KB