Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Revert previous commit (to r1.117)



details:   https://anonhg.NetBSD.org/src/rev/aa35a1c6aa84
branches:  trunk
changeset: 820030:aa35a1c6aa84
user:      maya <maya%NetBSD.org@localhost>
date:      Tue Dec 27 09:34:44 2016 +0000

description:
Revert previous commit (to r1.117)

Superfluous warnings in simple userland programs is not a valid reason to
break a security model.

diffstat:

 sys/kern/kern_module.c |  25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diffs (55 lines):

diff -r cfbd20e4d3a9 -r aa35a1c6aa84 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Tue Dec 27 08:56:00 2016 +0000
+++ b/sys/kern/kern_module.c    Tue Dec 27 09:34:44 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.118 2016/12/09 13:06:41 roy Exp $    */
+/*     $NetBSD: kern_module.c,v 1.119 2016/12/27 09:34:44 maya 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.118 2016/12/09 13:06:41 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.119 2016/12/27 09:34:44 maya Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -570,31 +570,20 @@
 module_load(const char *filename, int flags, prop_dictionary_t props,
            modclass_t modclass)
 {
-       module_t *mod;
        int error;
 
-       /* Test if we already have the module loaded before
-        * authorizing so we have the opportunity to return EEXIST. */
-       kernconfig_lock();
-       mod = module_lookup(filename);
-       if (mod != NULL) {
-               module_print("%s module `%s' already loaded",
-                   "requested", filename);
-               error = EEXIST;
-               goto out;
-       }
-
        /* Authorize. */
        error = kauth_authorize_system(kauth_cred_get(), KAUTH_SYSTEM_MODULE,
            0, (void *)(uintptr_t)MODCTL_LOAD, NULL, NULL);
-       if (error != 0)
-               goto out;
+       if (error != 0) {
+               return error;
+       }
 
+       kernconfig_lock();
        error = module_do_load(filename, false, flags, props, NULL, modclass,
            false);
+       kernconfig_unlock();
 
-out:
-       kernconfig_unlock();
        return error;
 }
 



Home | Main Index | Thread Index | Old Index