summaryrefslogtreecommitdiffstats
path: root/sys/kern/exec_elf.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-03-20 00:05:21 +0000
committerkettenis <kettenis@openbsd.org>2017-03-20 00:05:21 +0000
commit1443c5379bb94b29cfe84f375d67759bd24a3fad (patch)
tree6280dbe423db7a95463f7cc5d1da2ce6750699a7 /sys/kern/exec_elf.c
parentDon't identify the MC146818 RTC as operating in binary mode when we are really (diff)
downloadwireguard-openbsd-1443c5379bb94b29cfe84f375d67759bd24a3fad.tar.xz
wireguard-openbsd-1443c5379bb94b29cfe84f375d67759bd24a3fad.zip
Initialize the stack buffer used to build the auxiliary vector to zero to
avoid leaking the contents of the kernel stack into userspace. ok guenther@, deraadt@
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r--sys/kern/exec_elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 643a2165885..8ab7a0ebd50 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.139 2017/03/05 00:45:30 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.140 2017/03/20 00:05:21 kettenis Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -802,6 +802,7 @@ exec_elf_fixup(struct proc *p, struct exec_package *epp)
* linked binaries
*/
if (error == 0) {
+ memset(&ai, 0, sizeof ai);
a = ai;
a->au_id = AUX_phdr;