]> Git Repo - linux.git/commitdiff
tty: amiserial: fix TIOCSSERIAL permission check
authorJohan Hovold <[email protected]>
Wed, 7 Apr 2021 10:23:26 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <[email protected]>
Wed, 7 Apr 2021 15:22:07 +0000 (17:22 +0200)
Changing the port closing_wait parameter is a privileged operation.

Add the missing check to TIOCSSERIAL so that -EPERM is returned in case
an unprivileged user tries to change the closing-wait setting.

Cc: [email protected]
Signed-off-by: Johan Hovold <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/amiserial.c

index 0c8157fab17fad1dc4904ca212e4a2ca5e076ed0..ec6802ba2bf85d7766fae2c448fba346ce596083 100644 (file)
@@ -970,6 +970,7 @@ static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
        if (!serial_isroot()) {
                if ((ss->baud_base != state->baud_base) ||
                    (ss->close_delay != port->close_delay) ||
+                   (ss->closing_wait != port->closing_wait) ||
                    (ss->xmit_fifo_size != state->xmit_fifo_size) ||
                    ((ss->flags & ~ASYNC_USR_MASK) !=
                     (port->flags & ~ASYNC_USR_MASK))) {
This page took 0.054578 seconds and 4 git commands to generate.