]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: greybus: uart: fix unprivileged TIOCCSERIAL
authorJohan Hovold <johan@kernel.org>
Wed, 7 Apr 2021 10:23:24 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:45 +0000 (10:49 +0200)
commit6eedc68b7e1e01a560e2a55f74e0da7109383aa0
treee772f9803dca1e8b25f0a29690c2c0b65abb0901
parent28a945c5667de38790b030d3990c4039d780fad5
staging: greybus: uart: fix unprivileged TIOCCSERIAL

[ Upstream commit 60c6b305c11b5fd167ce5e2ce42f3a9098c388f0 ]

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 greybus implementation which instead indicated that the
TIOCSSERIAL ioctl was not even implemented when a non-privileged user
set the current values.

Fixes: e68453ed28c5 ("greybus: uart-gb: now builds, more framework added")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407102334.32361-7-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/greybus/uart.c