]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
NFC: pn533: fix bulk-message timeout
authorJohan Hovold <johan@kernel.org>
Mon, 13 Jan 2020 17:23:58 +0000 (18:23 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit3db4efba8dea644e54e339ac2e46b497aea93638
tree3c6a583de768a5bf4914a9691d2731d031ac312c
parent86eb9f7737aa240392242e34c2573d194d9e1cb1
NFC: pn533: fix bulk-message timeout

BugLink: https://bugs.launchpad.net/bugs/1862259
commit a112adafcb47760feff959ee1ecd10b74d2c5467 upstream.

The driver was doing a synchronous uninterruptible bulk-transfer without
using a timeout. This could lead to the driver hanging on probe due to a
malfunctioning (or malicious) device until the device is physically
disconnected. While sleeping in probe the driver prevents other devices
connected to the same hub from being added to (or removed from) the bus.

An arbitrary limit of five seconds should be more than enough.

Fixes: dbafc28955fa ("NFC: pn533: don't send USB data off of the stack")
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/nfc/pn533/usb.c