summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2019-07-05 17:14:48 +0000
committermaxv <maxv@NetBSD.org>2019-07-05 17:14:48 +0000
commit19fe073a4268b8deba2fee45f6bdbce3ad2547cc (patch)
treed66de239a97b83dd341c0aae00461df2eed4a013 /sys/kern/kern_exec.c
parent009a712fc98b78f4cf03b3eb7e9a16b22705104d (diff)
Fix info leak. The padding of 'sigact' is not initialized, it gets copied
in the proc, and can later be obtained by userland.
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index f6aa219ff77..3d25d869ee7 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.477 2019/06/27 19:56:10 maxv Exp $ */
+/* $NetBSD: kern_exec.c,v 1.478 2019/07/05 17:14:48 maxv Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.477 2019/06/27 19:56:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.478 2019/07/05 17:14:48 maxv Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@@ -2074,6 +2074,7 @@ spawn_return(void *arg)
/* handle posix_spawnattr */
if (spawn_data->sed_attrs != NULL) {
struct sigaction sigact;
+ memset(&sigact, 0, sizeof(sigact));
sigact._sa_u._sa_handler = SIG_DFL;
sigact.sa_flags = 0;