android_kernel_samsung_a7y1.../drivers/usb
Anthony Mallet f6cc747a02 USB: cdc-acm: fix rounding error in TIOCSSERIAL
[ Upstream commit b401f8c4f492cbf74f3f59c9141e5be3071071bb ]

By default, tty_port_init() initializes those parameters to a multiple
of HZ. For instance in line 69 of tty_port.c:
   port->close_delay = (50 * HZ) / 100;
https://github.com/torvalds/linux/blob/master/drivers/tty/tty_port.c#L69

With e.g. CONFIG_HZ = 250 (as this is the case for Ubuntu 18.04
linux-image-4.15.0-37-generic), the default setting for close_delay is
thus 125.

When ioctl(fd, TIOCGSERIAL, &s) is executed, the setting returned in
user space is '12' (125/10). When ioctl(fd, TIOCSSERIAL, &s) is then
executed with the same setting '12', the value is interpreted as '120'
which is different from the current setting and a EPERM error may be
raised by set_serial_info() if !CAP_SYS_ADMIN.
https://github.com/torvalds/linux/blob/master/drivers/usb/class/cdc-acm.c#L919

Fixes: ba2d8ce9db0a6 ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)")
Signed-off-by: Anthony Mallet <anthony.mallet@laas.fr>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200312133101.7096-2-anthony.mallet@laas.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 14:14:37 +02:00
..
atm USB: atm: ueagle-atm: add missing endpoint check 2020-04-07 13:06:35 +02:00
c67x00 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
chipidea usb: chipidea: host: Disable port power only if previously enabled 2020-04-07 13:29:31 +02:00
class USB: cdc-acm: fix rounding error in TIOCSSERIAL 2020-04-07 14:14:37 +02:00
common A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core usb: quirks: add NO_LPM quirk for RTL8153 based ethernet adapters 2020-04-07 14:14:03 +02:00
dwc2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dwc3 usb: dwc3: turn off VBUS when leaving host mode 2020-04-07 13:48:29 +02:00
early A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
gadget usb: gadget: serial: fix Tx stall after buffer overflow 2020-04-07 14:09:55 +02:00
host usb: host: xhci-plat: add a shutdown 2020-04-07 14:14:07 +02:00
image USB: microtek: fix info-leak at probe 2020-04-07 08:09:23 +02:00
isp1760 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
manager A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
misc USB: adutux: fix interface sanity check 2020-04-07 13:06:41 +02:00
mon usb: mon: Fix a deadlock in usbmon between mmap and read 2020-04-07 13:06:45 +02:00
musb usb: musb: dma: Correct parameter passed to IRQ handler 2020-04-07 13:32:48 +02:00
notify A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
phy A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
renesas_usbhs usb: renesas_usbhs: add suspend event support in gadget mode 2020-04-07 13:20:22 +02:00
serial USB: serial: pl2303: add device-id for HP LD381 2020-04-07 14:14:09 +02:00
storage usb: storage: Add quirk for Samsung Fit flash 2020-04-07 14:10:12 +02:00
typec A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usbip usbip: Fix error path of vhci_recv_ret_submit() 2020-04-07 13:22:24 +02:00
wusbcore A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
README A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usb-skeleton.c USB: usb-skeleton: fix NULL-deref on disconnect 2020-04-07 08:08:38 +02:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.