Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: mxser: fix TIOCSSERIAL permission check

Changing the port type and closing_wait parameter are privileged
operations so make sure to return -EPERM if a regular user tries to
change them.

Note that the closing_wait parameter would not actually have been
changed but the return value did not indicate that.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407102334.32361-15-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
b91cfb25 be6cf583

+5 -4
+5 -4
drivers/tty/mxser.c
··· 1270 1270 if (!capable(CAP_SYS_ADMIN)) { 1271 1271 if ((ss->baud_base != info->baud_base) || 1272 1272 (close_delay != info->port.close_delay) || 1273 + (closing_wait != info->port.closing_wait) || 1273 1274 ((ss->flags & ~ASYNC_USR_MASK) != (info->port.flags & ~ASYNC_USR_MASK))) { 1274 1275 mutex_unlock(&port->mutex); 1275 1276 return -EPERM; ··· 1297 1296 baud = ss->baud_base / ss->custom_divisor; 1298 1297 tty_encode_baud_rate(tty, baud, baud); 1299 1298 } 1299 + 1300 + info->type = ss->type; 1301 + 1302 + process_txrx_fifo(info); 1300 1303 } 1301 - 1302 - info->type = ss->type; 1303 - 1304 - process_txrx_fifo(info); 1305 1304 1306 1305 if (tty_port_initialized(port)) { 1307 1306 if (flags != (port->flags & ASYNC_SPD_MASK)) {