Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517123

[PATCH 2/3] tty: rocket: fix invalid user-pointer checks

From Johan Hovold <johan@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 2/3] tty: rocket: fix invalid user-pointer checks
Date 2016-11-08 13:30 +0100
Message-ID <sBdHj-SQ-1@gated-at.bofh.it> (permalink)
References <sBdHj-SQ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Drop invalid user-pointer checks from custom ioctl handlers.

A NULL-pointer can be valid in user space and copy_to_user() takes care
of sanity checking.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/tty/rocket.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index b0cc47c77b40..d66c1edd9892 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -1189,8 +1189,6 @@ static int get_config(struct r_port *info, struct rocket_config __user *retinfo)
 {
 	struct rocket_config tmp;
 
-	if (!retinfo)
-		return -EFAULT;
 	memset(&tmp, 0, sizeof (tmp));
 	mutex_lock(&info->port.mutex);
 	tmp.line = info->line;
@@ -1255,8 +1253,6 @@ static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
 	struct rocket_ports tmp;
 	int board;
 
-	if (!retports)
-		return -EFAULT;
 	memset(&tmp, 0, sizeof (tmp));
 	tmp.tty_major = rocket_driver->major;
 
-- 
2.7.3

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/3] tty: rocket: fix invalid user-pointer checks Johan Hovold <johan@kernel.org> - 2016-11-08 13:30 +0100

csiph-web