kill TIOCSERGSTRUCT
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 14 Sep 2018 18:46:18 +0000 (14:46 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Oct 2018 04:50:53 +0000 (00:50 -0400)
Once upon a time a bunch of serial drivers used to provide that;
today it's only amiserial and it's FUBAR - the structure being
copied to userland includes kernel pointers, fields with
config-dependent size, etc.  No userland code using it could
possibly survive - e.g. enabling lockdep definitely changes the
layout.  Besides, it's a massive infoleak.

Kill it.  If somebody needs that data for debugging purposes, they
can bloody well expose it saner ways.  Assuming anyone does debugging
of amiserial in the first place, that is.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/hp/sim/simserial.c
drivers/tty/amiserial.c
net/bluetooth/rfcomm/tty.c

index 759a3bbec18385350f01b56024e228b37b2b0e73..7aeb48a185763f7b944388634e2dcab38a1b7413 100644 (file)
@@ -309,14 +309,12 @@ static int rs_getserial(struct tty_struct *tty, struct serial_struct *ss)
 
 static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
 {
-       if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
-           (cmd != TIOCMIWAIT)) {
+       if ((cmd != TIOCSERCONFIG) && (cmd != TIOCMIWAIT)) {
                if (tty_io_error(tty))
                    return -EIO;
        }
 
        switch (cmd) {
-       case TIOCSERGSTRUCT:
        case TIOCMIWAIT:
                return 0;
        case TIOCSERCONFIG:
index 6992adf826f4a1071bc0ddf8725bbcb5b1419ec4..8330fd809a05f330ab17f82da1c968e8bcf12b9f 100644 (file)
@@ -1215,7 +1215,7 @@ static int rs_ioctl(struct tty_struct *tty,
        if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
                return -ENODEV;
 
-       if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
+       if ((cmd != TIOCSERCONFIG) &&
            (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
                if (tty_io_error(tty))
                    return -EIO;
@@ -1228,12 +1228,6 @@ static int rs_ioctl(struct tty_struct *tty,
                case TIOCSERGETLSR: /* Get line status register */
                        return get_lsr_info(info, argp);
 
-               case TIOCSERGSTRUCT:
-                       if (copy_to_user(argp,
-                                        info, sizeof(struct serial_state)))
-                               return -EFAULT;
-                       return 0;
-
                /*
                 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
                 * - mask passed in arg for lines of interest
index ba4f59389405d36a5f7b8ddc5cd61f1ed58cdc48..0c7d31c6c18cc1461118aa414fc001440bae38a1 100644 (file)
@@ -839,10 +839,6 @@ static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned l
                BT_DBG("TIOCMIWAIT");
                break;
 
-       case TIOCSERGSTRUCT:
-               BT_ERR("TIOCSERGSTRUCT is not supported");
-               return -ENOIOCTLCMD;
-
        case TIOCSERGETLSR:
                BT_ERR("TIOCSERGETLSR is not supported");
                return -ENOIOCTLCMD;