This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / module.c
index dfe295e..300269d 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <asm/cacheflush.h>
+#include "module-verify.h"
 
 #if 0
 #define DEBUGP printk
@@ -51,6 +52,9 @@
 /* If this is set, the section belongs in the init part of the module */
 #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
 
+#define symbol_is(literal, string)                             \
+       (strcmp(MODULE_SYMBOL_PREFIX literal, (string)) == 0)
+
 /* Protects module list */
 static spinlock_t modlist_lock = SPIN_LOCK_UNLOCKED;
 
@@ -1624,6 +1628,14 @@ static struct module *load_module(void __user *umod,
                goto free_hdr;
        }
 
+       /* verify the signature on the module */
+#ifdef CONFIG_MODULE_SIG
+       if (module_verify_sig(hdr, sechdrs, secstrings, mod)) {
+               err = -EPERM;
+               goto free_hdr;
+       }
+#endif
+
        /* Now copy in args */
        arglen = strlen_user(uargs);
        if (!arglen) {
@@ -2154,8 +2166,13 @@ void print_modules(void)
        struct module *mod;
 
        printk("Modules linked in:");
-       list_for_each_entry(mod, &modules, list)
+       list_for_each_entry(mod, &modules, list) {
                printk(" %s", mod->name);
+#if CONFIG_MODULE_SIG          
+               if (!mod->gpgsig_ok)
+                       printk("(U)");
+#endif         
+       }
        printk("\n");
 }