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

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>

Al Viro ce5a9831 f0193d3e

+2 -14
+1 -3
arch/ia64/hp/sim/simserial.c
··· 309 309 310 310 static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) 311 311 { 312 - if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && 313 - (cmd != TIOCMIWAIT)) { 312 + if ((cmd != TIOCSERCONFIG) && (cmd != TIOCMIWAIT)) { 314 313 if (tty_io_error(tty)) 315 314 return -EIO; 316 315 } 317 316 318 317 switch (cmd) { 319 - case TIOCSERGSTRUCT: 320 318 case TIOCMIWAIT: 321 319 return 0; 322 320 case TIOCSERCONFIG:
+1 -7
drivers/tty/amiserial.c
··· 1215 1215 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1216 1216 return -ENODEV; 1217 1217 1218 - if ((cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && 1218 + if ((cmd != TIOCSERCONFIG) && 1219 1219 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { 1220 1220 if (tty_io_error(tty)) 1221 1221 return -EIO; ··· 1227 1227 1228 1228 case TIOCSERGETLSR: /* Get line status register */ 1229 1229 return get_lsr_info(info, argp); 1230 - 1231 - case TIOCSERGSTRUCT: 1232 - if (copy_to_user(argp, 1233 - info, sizeof(struct serial_state))) 1234 - return -EFAULT; 1235 - return 0; 1236 1230 1237 1231 /* 1238 1232 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
-4
net/bluetooth/rfcomm/tty.c
··· 839 839 BT_DBG("TIOCMIWAIT"); 840 840 break; 841 841 842 - case TIOCSERGSTRUCT: 843 - BT_ERR("TIOCSERGSTRUCT is not supported"); 844 - return -ENOIOCTLCMD; 845 - 846 842 case TIOCSERGETLSR: 847 843 BT_ERR("TIOCSERGETLSR is not supported"); 848 844 return -ENOIOCTLCMD;