diff mbox series

[06/20] n_hdlc_tty_read(): remove pointless access_ok()

Message ID 20200509234557.1124086-6-viro@ZenIV.linux.org.uk (mailing list archive)
State New, archived
Headers show
Series [01/20] dlmfs_file_write(): get rid of pointless access_ok() | expand

Commit Message

Al Viro May 9, 2020, 11:45 p.m. UTC
From: Al Viro <viro@zeniv.linux.org.uk>

only copy_to_user() is done to the address in question

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/tty/n_hdlc.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Greg Kroah-Hartman May 15, 2020, 10:53 a.m. UTC | #1
On Sun, May 10, 2020 at 12:45:43AM +0100, Al Viro wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
> 
> only copy_to_user() is done to the address in question
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  drivers/tty/n_hdlc.c | 7 -------
>  1 file changed, 7 deletions(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff mbox series

Patch

diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c
index 991f49ee4026..b09eac4b6d64 100644
--- a/drivers/tty/n_hdlc.c
+++ b/drivers/tty/n_hdlc.c
@@ -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 (;;) {