aboutsummaryrefslogtreecommitdiffstats
path: root/security/capability.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-08-13 09:44:57 -0400
committerJames Morris <jmorris@namei.org>2009-08-13 21:18:37 -0400
commit9188499cdb117d86a1ea6b04374095b098d56936 (patch)
tree7c0dd23f2c98630c426cbd0bfbf5e46cc689091e /security/capability.c
parenta8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c (diff)
security: introducing security_request_module
Calling request_module() will trigger a userspace upcall which will load a new module into the kernel. This can be a dangerous event if the process able to trigger request_module() is able to control either the modprobe binary or the module binary. This patch adds a new security hook to request_module() which can be used by an LSM to control a processes ability to call request_module(). Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/capability.c')
-rw-r--r--security/capability.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/capability.c b/security/capability.c
index ec0573054024..1b943f54b2ea 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -396,6 +396,11 @@ static int cap_kernel_create_files_as(struct cred *new, struct inode *inode)
396 return 0; 396 return 0;
397} 397}
398 398
399static int cap_kernel_module_request(void)
400{
401 return 0;
402}
403
399static int cap_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags) 404static int cap_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
400{ 405{
401 return 0; 406 return 0;
@@ -945,6 +950,7 @@ void security_fixup_ops(struct security_operations *ops)
945 set_to_cap_if_null(ops, cred_commit); 950 set_to_cap_if_null(ops, cred_commit);
946 set_to_cap_if_null(ops, kernel_act_as); 951 set_to_cap_if_null(ops, kernel_act_as);
947 set_to_cap_if_null(ops, kernel_create_files_as); 952 set_to_cap_if_null(ops, kernel_create_files_as);
953 set_to_cap_if_null(ops, kernel_module_request);
948 set_to_cap_if_null(ops, task_setuid); 954 set_to_cap_if_null(ops, task_setuid);
949 set_to_cap_if_null(ops, task_fix_setuid); 955 set_to_cap_if_null(ops, task_fix_setuid);
950 set_to_cap_if_null(ops, task_setgid); 956 set_to_cap_if_null(ops, task_setgid);