]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
USB: cdc-acm: fix unprivileged TIOCCSERIAL
authorJohan Hovold <johan@kernel.org>
Thu, 8 Apr 2021 13:16:01 +0000 (15:16 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 26 May 2021 13:39:14 +0000 (15:39 +0200)
commit1e9d4b4db569c477ed1ff51e91838570f13799e0
tree4edb2d2751f96f6d31bb2318eeec0bd1333059b3
parent7f119b80b5503ff4d32fe1ce675b89c5cf145575
USB: cdc-acm: fix unprivileged TIOCCSERIAL

BugLink: https://bugs.launchpad.net/bugs/1929615
[ Upstream commit dd5619582d60007139f0447382d2839f4f9e339b ]

TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

A non-privileged user has only ever been able to set the since long
deprecated ASYNC_SPD flags and trying to change any other *supported*
feature should result in -EPERM being returned. Setting the current
values for any supported features should return success.

Fix the cdc-acm implementation which instead indicated that the
TIOCSSERIAL ioctl was not even implemented when a non-privileged user
set the current values.

Fixes: ba2d8ce9db0a ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)")
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210408131602.27956-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/usb/class/cdc-acm.c