Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Return ENOEXEC instead of 0 if the info of a kernel...



details:   https://anonhg.NetBSD.org/src/rev/d1ce4cd44f77
branches:  trunk
changeset: 771020:d1ce4cd44f77
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 06 12:40:04 2011 +0000

description:
Return ENOEXEC instead of 0 if the info of a kernel module doesn't have the
expected size. This prevents kernel panics when loading broken modules.

diffstat:

 sys/kern/kern_module.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a7f3ab347468 -r d1ce4cd44f77 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Sun Nov 06 12:07:21 2011 +0000
+++ b/sys/kern/kern_module.c    Sun Nov 06 12:40:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.83 2011/10/18 12:25:31 jmcneill Exp $        */
+/*     $NetBSD: kern_module.c,v 1.84 2011/11/06 12:40:04 tron Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.83 2011/10/18 12:25:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.84 2011/11/06 12:40:04 tron Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1233,7 +1233,7 @@
        }
        if (size != sizeof(modinfo_t **)) {
                module_error("`link_set_modules' section wrong size");
-               return error;
+               return ENOEXEC;
        }
        mod->mod_info = *(modinfo_t **)addr;
 



Home | Main Index | Thread Index | Old Index