svn commit: r330821 - head/sys/kern

Brooks Davis brooks at FreeBSD.org
Mon Mar 12 23:04:43 UTC 2018


Author: brooks
Date: Mon Mar 12 23:04:42 2018
New Revision: 330821
URL: https://svnweb.freebsd.org/changeset/base/330821

Log:
  Use the stack for temporary storage in OTIOCCONS.
  
  The old code used the thread's pcb via the uap->data pointer.
  
  Reviewed by:	ed
  Approved by:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14674

Modified:
  head/sys/kern/tty_compat.c

Modified: head/sys/kern/tty_compat.c
==============================================================================
--- head/sys/kern/tty_compat.c	Mon Mar 12 23:02:01 2018	(r330820)
+++ head/sys/kern/tty_compat.c	Mon Mar 12 23:04:42 2018	(r330821)
@@ -262,9 +262,11 @@ tty_ioctl_compat(struct tty *tp, u_long com, caddr_t d
 			fflag, td));
 	    }
 
-	case OTIOCCONS:
-		*(int *)data = 1;
-		return (tty_ioctl(tp, TIOCCONS, data, fflag, td));
+	case OTIOCCONS: {
+		int one = 1;
+
+		return (tty_ioctl(tp, TIOCCONS, (caddr_t)&one, fflag, td));
+	}
 
 	default:
 		return (ENOIOCTL);


More information about the svn-src-head mailing list