aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 13:01:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-11 13:01:41 -0400
commit3296ca27f50ecbd71db1d808c7a72d311027f919 (patch)
tree833eaa58b2013bda86d4bd95faf6efad7a2d5ca4 /kernel/module.c
parente893123c7378192c094747dadec326b7c000c190 (diff)
parent73fbad283cfbbcf02939bdbda31fc4a30e729cca (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (44 commits) nommu: Provide mmap_min_addr definition. TOMOYO: Add description of lists and structures. TOMOYO: Remove unused field. integrity: ima audit dentry_open failure TOMOYO: Remove unused parameter. security: use mmap_min_addr indepedently of security models TOMOYO: Simplify policy reader. TOMOYO: Remove redundant markers. SELinux: define audit permissions for audit tree netlink messages TOMOYO: Remove unused mutex. tomoyo: avoid get+put of task_struct smack: Remove redundant initialization. integrity: nfsd imbalance bug fix rootplug: Remove redundant initialization. smack: do not beyond ARRAY_SIZE of data integrity: move ima_counts_get integrity: path_check update IMA: Add __init notation to ima functions IMA: Minimal IMA policy and boot param for TCB IMA policy selinux: remove obsolete read buffer limit from sel_read_bool ...
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 2383e60fcf3f..278e9b6762bb 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -73,6 +73,9 @@ DEFINE_MUTEX(module_mutex);
73EXPORT_SYMBOL_GPL(module_mutex); 73EXPORT_SYMBOL_GPL(module_mutex);
74static LIST_HEAD(modules); 74static LIST_HEAD(modules);
75 75
76/* Block module loading/unloading? */
77int modules_disabled = 0;
78
76/* Waiting for a module to finish initializing? */ 79/* Waiting for a module to finish initializing? */
77static DECLARE_WAIT_QUEUE_HEAD(module_wq); 80static DECLARE_WAIT_QUEUE_HEAD(module_wq);
78 81
@@ -778,7 +781,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
778 char name[MODULE_NAME_LEN]; 781 char name[MODULE_NAME_LEN];
779 int ret, forced = 0; 782 int ret, forced = 0;
780 783
781 if (!capable(CAP_SYS_MODULE)) 784 if (!capable(CAP_SYS_MODULE) || modules_disabled)
782 return -EPERM; 785 return -EPERM;
783 786
784 if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0) 787 if (strncpy_from_user(name, name_user, MODULE_NAME_LEN-1) < 0)
@@ -2338,7 +2341,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
2338 int ret = 0; 2341 int ret = 0;
2339 2342
2340 /* Must have permission */ 2343 /* Must have permission */
2341 if (!capable(CAP_SYS_MODULE)) 2344 if (!capable(CAP_SYS_MODULE) || modules_disabled)
2342 return -EPERM; 2345 return -EPERM;
2343 2346
2344 /* Only one module load at a time, please */ 2347 /* Only one module load at a time, please */