summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2015-10-18 16:59:19 +0000
committermaxv <maxv@NetBSD.org>2015-10-18 16:59:19 +0000
commitbbbdca85de02f821cf33987474a8e140ec7ab426 (patch)
tree28ea32a9511b57e7838d8e2604c7d07eeb99a3da /sys/compat/linux/common
parentd867b44c859950d7d5c021109f7498eefda38313 (diff)
Make sure we have space for the aout header.
Diffstat (limited to 'sys/compat/linux/common')
-rw-r--r--sys/compat/linux/common/linux_exec_aout.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/compat/linux/common/linux_exec_aout.c b/sys/compat/linux/common/linux_exec_aout.c
index 2efdd6a9d59..77d35d22f62 100644
--- a/sys/compat/linux/common/linux_exec_aout.c
+++ b/sys/compat/linux/common/linux_exec_aout.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_aout.c,v 1.67 2014/11/09 17:48:08 maxv Exp $ */
+/* $NetBSD: linux_exec_aout.c,v 1.68 2015/10/18 16:59:19 maxv Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.67 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.68 2015/10/18 16:59:19 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -135,10 +135,12 @@ exec_linux_aout_makecmds(struct lwp *l, struct exec_package *epp)
int machtype, magic;
int error = ENOEXEC;
+ if (epp->ep_hdrvalid < sizeof(struct exec))
+ return ENOEXEC;
+
magic = LINUX_N_MAGIC(linux_ep);
machtype = LINUX_N_MACHTYPE(linux_ep);
-
if (machtype != LINUX_MID_MACHINE)
return (ENOEXEC);