summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec_elf32.c
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2014-02-21 07:53:53 +0000
committermaxv <maxv@NetBSD.org>2014-02-21 07:53:53 +0000
commitd91ba50b1f2201f6aece5635388d036fdcd2b58b (patch)
treeca42f6492c658263510e0dd53a3feca5b772e243 /sys/compat/linux/common/linux_exec_elf32.c
parent2c728e7209ae0e0fe3fcf7b24c2a60499f85e66c (diff)
Increase LINUX32_ELF_AUX_ENTRIES to avoid overrun in linux32/. Also,
add comments and KASSERTs to make sure people don't forget to increase XX_AUX_ENTRIES's when adding vectors. Reported by martin@ (CV), with suggestions from chs@. ok martin@ chs@
Diffstat (limited to 'sys/compat/linux/common/linux_exec_elf32.c')
-rw-r--r--sys/compat/linux/common/linux_exec_elf32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c
index 1d368e307c6..d1565017c0e 100644
--- a/sys/compat/linux/common/linux_exec_elf32.c
+++ b/sys/compat/linux/common/linux_exec_elf32.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_elf32.c,v 1.88 2014/02/09 16:41:42 chs Exp $ */
+/* $NetBSD: linux_exec_elf32.c,v 1.89 2014/02/21 07:53:53 maxv Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.88 2014/02/09 16:41:42 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.89 2014/02/21 07:53:53 maxv Exp $");
#ifndef ELFSIZE
/* XXX should die */
@@ -495,6 +495,7 @@ ELFNAME2(linux,copyargs)(struct lwp *l, struct exec_package *pack,
*stackp += len;
len = (a - ai) * sizeof(AuxInfo);
+ KASSERT(len <= LINUX_ELF_AUX_ENTRIES);
if ((error = copyout(ai, *stackp, len)) != 0)
return error;
*stackp += len;