n_hdlc_tty_read(): remove pointless access_ok()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 18 Feb 2020 17:42:57 +0000 (12:42 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 May 2020 15:03:03 +0000 (11:03 -0400)
only copy_to_user() is done to the address in question

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/tty/n_hdlc.c

index 991f49e..b09eac4 100644 (file)
@@ -423,13 +423,6 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
        struct n_hdlc_buf *rbuf;
        DECLARE_WAITQUEUE(wait, current);
 
-       /* verify user access to buffer */
-       if (!access_ok(buf, nr)) {
-               pr_warn("%s(%d) %s() can't verify user buffer\n",
-                               __FILE__, __LINE__, __func__);
-               return -EFAULT;
-       }
-
        add_wait_queue(&tty->read_wait, &wait);
 
        for (;;) {