X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fmodule.c;h=cb3887e770e21b2ca9244bef84ae19b1e9f2d3e5;hb=d254117099d711f215e62427f55dfb8ebd5ad011;hp=e797812a4d95f164bb377447a62de3089c0ba182;hpb=b897e6fbc49dd84b2634bca664344d503b907ce9;p=pandora-kernel.git diff --git a/kernel/module.c b/kernel/module.c index e797812a4d95..cb3887e770e2 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -72,6 +72,9 @@ DEFINE_MUTEX(module_mutex); EXPORT_SYMBOL_GPL(module_mutex); static LIST_HEAD(modules); +/* Block module loading/unloading? */ +int modules_disabled = 0; + /* Waiting for a module to finish initializing? */ static DECLARE_WAIT_QUEUE_HEAD(module_wq); @@ -777,7 +780,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, char name[MODULE_NAME_LEN]; int ret, forced = 0; - if (!capable(CAP_SYS_MODULE)) + if (!capable(CAP_SYS_MODULE) || modules_disabled) return -EPERM; if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) @@ -2336,7 +2339,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, int ret = 0; /* Must have permission */ - if (!capable(CAP_SYS_MODULE)) + if (!capable(CAP_SYS_MODULE) || modules_disabled) return -EPERM; /* Only one module load at a time, please */