lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180913024049.24567-34-viro@ZenIV.linux.org.uk>
Date:   Thu, 13 Sep 2018 03:40:33 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 34/50] complete ->[sg]et_serial() switchover

From: Al Viro <viro@...iv.linux.org.uk>

Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
 drivers/tty/tty_io.c            | 12 ++++--------
 drivers/usb/serial/usb-serial.c |  4 ++--
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 91d73732e11c..80d6c041c87e 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2474,7 +2474,7 @@ static int tty_tiocsserial(struct tty_struct *tty, struct serial_struct __user *
 		pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n",
 			__func__, get_task_comm(comm, current), flags);
 	if (!tty->ops->set_serial)
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	return tty->ops->set_serial(tty, &v);
 }
 
@@ -2485,7 +2485,7 @@ static int tty_tiocgserial(struct tty_struct *tty, struct serial_struct __user *
 	memset(&v, 0, sizeof(struct serial_struct));
 
 	if (!tty->ops->set_serial)
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	err = tty->ops->get_serial(tty, &v);
 	if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
 		err = -EFAULT;
@@ -2621,13 +2621,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		}
 		break;
 	case TIOCSSERIAL:
-		retval = tty_tiocsserial(tty, p);
-		if (retval != -ENOIOCTLCMD)
-			return retval;
+		return tty_tiocsserial(tty, p);
 	case TIOCGSERIAL:
-		retval = tty_tiocgserial(tty, p);
-		if (retval != -ENOIOCTLCMD)
-			return retval;
+		return tty_tiocgserial(tty, p);
 	case TIOCGPTPEER:
 		/* Special because the struct file is needed */
 		return ptm_open_peer(file, tty, (int)arg);
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8bdc48fa5a67..b633f57a86ec 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -401,7 +401,7 @@ static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 	struct usb_serial_port *port = tty->driver_data;
 	if (port->serial->type->get_serial)
 		return port->serial->type->get_serial(tty, ss);
-	return -ENOIOCTLCMD;
+	return -ENOTTY;
 }
 
 static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
@@ -409,7 +409,7 @@ static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
 	struct usb_serial_port *port = tty->driver_data;
 	if (port->serial->type->set_serial)
 		return port->serial->type->get_serial(tty, ss);
-	return -ENOIOCTLCMD;
+	return -ENOTTY;
 }
 
 static int serial_ioctl(struct tty_struct *tty,
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ