Skip to content

Commit ce5a983

Browse files
author
Al Viro
committed
kill TIOCSERGSTRUCT
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>
1 parent f0193d3 commit ce5a983

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

arch/ia64/hp/sim/simserial.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,12 @@ static int rs_getserial(struct tty_struct *tty, struct serial_struct *ss)
309309

310310
static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
311311
{
312-
if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
313-
(cmd != TIOCMIWAIT)) {
312+
if ((cmd != TIOCSERCONFIG) && (cmd != TIOCMIWAIT)) {
314313
if (tty_io_error(tty))
315314
return -EIO;
316315
}
317316

318317
switch (cmd) {
319-
case TIOCSERGSTRUCT:
320318
case TIOCMIWAIT:
321319
return 0;
322320
case TIOCSERCONFIG:

drivers/tty/amiserial.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ static int rs_ioctl(struct tty_struct *tty,
12151215
if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
12161216
return -ENODEV;
12171217

1218-
if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
1218+
if ((cmd != TIOCSERCONFIG) &&
12191219
(cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
12201220
if (tty_io_error(tty))
12211221
return -EIO;
@@ -1228,12 +1228,6 @@ static int rs_ioctl(struct tty_struct *tty,
12281228
case TIOCSERGETLSR: /* Get line status register */
12291229
return get_lsr_info(info, argp);
12301230

1231-
case TIOCSERGSTRUCT:
1232-
if (copy_to_user(argp,
1233-
info, sizeof(struct serial_state)))
1234-
return -EFAULT;
1235-
return 0;
1236-
12371231
/*
12381232
* Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
12391233
* - mask passed in arg for lines of interest

net/bluetooth/rfcomm/tty.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,6 @@ static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned l
839839
BT_DBG("TIOCMIWAIT");
840840
break;
841841

842-
case TIOCSERGSTRUCT:
843-
BT_ERR("TIOCSERGSTRUCT is not supported");
844-
return -ENOIOCTLCMD;
845-
846842
case TIOCSERGETLSR:
847843
BT_ERR("TIOCSERGETLSR is not supported");
848844
return -ENOIOCTLCMD;

0 commit comments

Comments
 (0)