summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-07-20 16:47:21 +0000
committermpi <mpi@openbsd.org>2017-07-20 16:47:21 +0000
commit2464381ce4efec2c8002fd2c4af6a1764eb1548f (patch)
tree4cd62e9b35fa3033bcf83e5c1a02ab598ec4d928
parentAvoid cross reference to mandoc(1) because it may cause a message (diff)
downloadwireguard-openbsd-2464381ce4efec2c8002fd2c4af6a1764eb1548f.tar.xz
wireguard-openbsd-2464381ce4efec2c8002fd2c4af6a1764eb1548f.zip
Initialize a local variable to not leak kernel stack info to userland
if TIOCGPGRP fail. Issue found by Ilja van Sprundel. ok bluhm@, millert@, deraadt@
-rw-r--r--sys/kern/kern_descrip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 827fc9502f6..623015f75fd 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.140 2017/02/11 19:51:06 guenther Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.141 2017/07/20 16:47:21 mpi Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -435,6 +435,7 @@ restart:
*retval = ((struct pipe *)fp->f_data)->pipe_pgid;
break;
}
+ tmp = 0;
error = (*fp->f_ops->fo_ioctl)
(fp, TIOCGPGRP, (caddr_t)&tmp, p);
*retval = -tmp;