Module Name: src
Committed By: njoly
Date: Sun Feb 23 11:09:42 UTC 2014
Modified Files:
src/sys/compat/linux/common: linux_exec_elf32.c
src/sys/compat/linux32/common: linux32_exec_elf32.c
Log Message:
Fix wrong KASSERTs. Do not compare size vs. entries count.
To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/linux/common/linux_exec_elf32.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/linux32/common/linux32_exec_elf32.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/common/linux_exec_elf32.c
diff -u src/sys/compat/linux/common/linux_exec_elf32.c:1.89 src/sys/compat/linux/common/linux_exec_elf32.c:1.90
--- src/sys/compat/linux/common/linux_exec_elf32.c:1.89 Fri Feb 21 07:53:53 2014
+++ src/sys/compat/linux/common/linux_exec_elf32.c Sun Feb 23 11:09:42 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_elf32.c,v 1.89 2014/02/21 07:53:53 maxv Exp $ */
+/* $NetBSD: linux_exec_elf32.c,v 1.90 2014/02/23 11:09:42 njoly 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.89 2014/02/21 07:53:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.90 2014/02/23 11:09:42 njoly Exp $");
#ifndef ELFSIZE
/* XXX should die */
@@ -495,7 +495,7 @@ ELFNAME2(linux,copyargs)(struct lwp *l,
*stackp += len;
len = (a - ai) * sizeof(AuxInfo);
- KASSERT(len <= LINUX_ELF_AUX_ENTRIES);
+ KASSERT(len <= LINUX_ELF_AUX_ENTRIES * sizeof(AuxInfo));
if ((error = copyout(ai, *stackp, len)) != 0)
return error;
*stackp += len;
Index: src/sys/compat/linux32/common/linux32_exec_elf32.c
diff -u src/sys/compat/linux32/common/linux32_exec_elf32.c:1.15 src/sys/compat/linux32/common/linux32_exec_elf32.c:1.16
--- src/sys/compat/linux32/common/linux32_exec_elf32.c:1.15 Fri Feb 21 07:53:53 2014
+++ src/sys/compat/linux32/common/linux32_exec_elf32.c Sun Feb 23 11:09:42 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec_elf32.c,v 1.15 2014/02/21 07:53:53 maxv Exp $ */
+/* $NetBSD: linux32_exec_elf32.c,v 1.16 2014/02/23 11:09:42 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2001,2006 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.15 2014/02/21 07:53:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.16 2014/02/23 11:09:42 njoly Exp $");
#define ELFSIZE 32
@@ -241,7 +241,7 @@ linux32_elf32_copyargs(struct lwp *l, st
#endif
len = (a - ai) * sizeof(AuxInfo);
- KASSERT(len <= LINUX32_ELF_AUX_ENTRIES);
+ KASSERT(len <= LINUX32_ELF_AUX_ENTRIES * sizeof(AuxInfo));
if ((error = copyout(ai, *stackp, len)) != 0)
return error;
*stackp += len;