Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat Fix wrong KASSERTs. Do not compare size vs. entri...



details:   https://anonhg.NetBSD.org/src/rev/7f75b75ebb13
branches:  trunk
changeset: 793689:7f75b75ebb13
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sun Feb 23 11:09:42 2014 +0000

description:
Fix wrong KASSERTs. Do not compare size vs. entries count.

diffstat:

 sys/compat/linux/common/linux_exec_elf32.c     |  6 +++---
 sys/compat/linux32/common/linux32_exec_elf32.c |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r f834bf7b6f95 -r 7f75b75ebb13 sys/compat/linux/common/linux_exec_elf32.c
--- a/sys/compat/linux/common/linux_exec_elf32.c        Sun Feb 23 08:07:33 2014 +0000
+++ b/sys/compat/linux/common/linux_exec_elf32.c        Sun Feb 23 11:09:42 2014 +0000
@@ -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 @@
        *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;
diff -r f834bf7b6f95 -r 7f75b75ebb13 sys/compat/linux32/common/linux32_exec_elf32.c
--- a/sys/compat/linux32/common/linux32_exec_elf32.c    Sun Feb 23 08:07:33 2014 +0000
+++ b/sys/compat/linux32/common/linux32_exec_elf32.c    Sun Feb 23 11:09:42 2014 +0000
@@ -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 @@
 #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;



Home | Main Index | Thread Index | Old Index