diff options
author | Kees Cook <keescook@chromium.org> | 2011-12-21 15:17:03 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-02-09 17:14:51 -0500 |
commit | 1a2a4d06e1e95260c470ebe3a945f61bbe8c1fd8 (patch) | |
tree | 7167d158749a7acf2ce8bbe1ecd25234b654e813 /security/capability.c | |
parent | 9e3ff38647a316e4f92d59b14c8f0eb13b33bb2c (diff) |
security: create task_free security callback
The current LSM interface to cred_free is not sufficient for allowing
an LSM to track the life and death of a task. This patch adds the
task_free hook so that an LSM can clean up resources on task death.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/capability.c')
-rw-r--r-- | security/capability.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/security/capability.c b/security/capability.c index 2f680eb02b59..5bb21b1c448c 100644 --- a/security/capability.c +++ b/security/capability.c | |||
@@ -358,6 +358,10 @@ static int cap_task_create(unsigned long clone_flags) | |||
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
360 | 360 | ||
361 | static void cap_task_free(struct task_struct *task) | ||
362 | { | ||
363 | } | ||
364 | |||
361 | static int cap_cred_alloc_blank(struct cred *cred, gfp_t gfp) | 365 | static int cap_cred_alloc_blank(struct cred *cred, gfp_t gfp) |
362 | { | 366 | { |
363 | return 0; | 367 | return 0; |
@@ -954,6 +958,7 @@ void __init security_fixup_ops(struct security_operations *ops) | |||
954 | set_to_cap_if_null(ops, file_receive); | 958 | set_to_cap_if_null(ops, file_receive); |
955 | set_to_cap_if_null(ops, dentry_open); | 959 | set_to_cap_if_null(ops, dentry_open); |
956 | set_to_cap_if_null(ops, task_create); | 960 | set_to_cap_if_null(ops, task_create); |
961 | set_to_cap_if_null(ops, task_free); | ||
957 | set_to_cap_if_null(ops, cred_alloc_blank); | 962 | set_to_cap_if_null(ops, cred_alloc_blank); |
958 | set_to_cap_if_null(ops, cred_free); | 963 | set_to_cap_if_null(ops, cred_free); |
959 | set_to_cap_if_null(ops, cred_prepare); | 964 | set_to_cap_if_null(ops, cred_prepare); |