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>] [day] [month] [year] [list]
Message-Id: <1162915989.11073.76.camel@localhost.localdomain>
Date:	Tue, 07 Nov 2006 16:13:09 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	akpm@...l.org, linux-kernel@...r.kernel.org
Subject: [PATCH] tty_ioctl: use termios for the old structure and termios2
	for the new

Having split out the user and kernel structures it turns out that some
non glibc C libraries pull their termios struct from the kernel headers
directly or indirectly. This means we must keep "struct termios" as the
library sees it correct for the old ioctls. Not a big problem just
shuffle the names and ifdef around a bit

Signed-off-by: Alan Cox <alan@...hat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.19-rc4-mm1/drivers/char/tty_ioctl.c linux-2.6.19-rc4-mm1/drivers/char/tty_ioctl.c
--- linux.vanilla-2.6.19-rc4-mm1/drivers/char/tty_ioctl.c	2006-10-31 21:11:49.000000000 +0000
+++ linux-2.6.19-rc4-mm1/drivers/char/tty_ioctl.c	2006-11-07 10:05:02.000000000 +0000
@@ -408,14 +408,18 @@
 	} else if (opt & TERMIOS_OLD) {
 		memcpy(&tmp_termios, tty->termios, sizeof(struct termios));
 		if (user_termios_to_kernel_termios_1(&tmp_termios,
-						(struct termios_v1 __user *)arg))
+						(struct termios __user *)arg))
 			return -EFAULT;
-#endif
 	} else {
 		if (user_termios_to_kernel_termios(&tmp_termios,
-						(struct termios __user *)arg))
+						(struct termios2 __user *)arg))
 			return -EFAULT;
 	}
+#else
+	else if (user_termios_to_kernel_termios(&tmp_termios,
+					(struct termios __user *)arg))
+		return -EFAULT;
+#endif
 
 	/* If old style Bfoo values are used then load c_ispeed/c_ospeed with the real speed
 	   so its unconditionally usable */
@@ -707,11 +711,11 @@
 			return 0;
 #else
 		case TCGETS:
-			if (kernel_termios_to_user_termios_1((struct termios_v1 __user *)arg, real_tty->termios))
+			if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios))
 				return -EFAULT;
 			return 0;
 		case TCGETS2:
-			if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios))
+			if (kernel_termios_to_user_termios((struct termios2 __user *)arg, real_tty->termios))
 				return -EFAULT;
 			return 0;
 		case TCSETSF2:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ