Commit fd74e378 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] jantior: sx: use get/put_user (remove verify_area)

From: Domen Puncer <domen@coderock.org>

Use get_user/put_user to check user addressing,
don't need to use verify_area also.
parent 541f1064
...@@ -1760,9 +1760,7 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, ...@@ -1760,9 +1760,7 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
(unsigned int *) arg); (unsigned int *) arg);
break; break;
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(int))) == 0) {
get_user(ival, (unsigned int *) arg);
tty->termios->c_cflag = tty->termios->c_cflag =
(tty->termios->c_cflag & ~CLOCAL) | (tty->termios->c_cflag & ~CLOCAL) |
(ival ? CLOCAL : 0); (ival ? CLOCAL : 0);
...@@ -1786,27 +1784,21 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp, ...@@ -1786,27 +1784,21 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
} }
break; break;
case TIOCMBIS: case TIOCMBIS:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1), sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : -1),
((ival & TIOCM_RTS) ? 1 : -1)); ((ival & TIOCM_RTS) ? 1 : -1));
sx_reconfigure_port(port); sx_reconfigure_port(port);
} }
break; break;
case TIOCMBIC: case TIOCMBIC:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
sx_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1), sx_setsignals(port, ((ival & TIOCM_DTR) ? 0 : -1),
((ival & TIOCM_RTS) ? 0 : -1)); ((ival & TIOCM_RTS) ? 0 : -1));
sx_reconfigure_port(port); sx_reconfigure_port(port);
} }
break; break;
case TIOCMSET: case TIOCMSET:
if ((rc = verify_area(VERIFY_READ, (void *) arg, if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
sizeof(unsigned int))) == 0) {
get_user(ival, (unsigned int *) arg);
sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0), sx_setsignals(port, ((ival & TIOCM_DTR) ? 1 : 0),
((ival & TIOCM_RTS) ? 1 : 0)); ((ival & TIOCM_RTS) ? 1 : 0));
sx_reconfigure_port(port); sx_reconfigure_port(port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment