diff options
author | David Quigley <dpquigl@tycho.nsa.gov> | 2006-06-30 04:55:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 14:25:37 -0400 |
commit | a1836a42daf5ddfe9a891973734bd9a7d62eb504 (patch) | |
tree | e8819aec40aff3fa0eecd2ef9d92df8213bce58b /security/selinux | |
parent | 7a01955f99b65622a00ba5c8b39202ddc6fa65f8 (diff) |
[PATCH] SELinux: Add security hook definition for getioprio and insert hooks
Add a new security hook definition for the sys_ioprio_get operation. At
present, the SELinux hook function implementation for this hook is
identical to the getscheduler implementation but a separate hook is
introduced to allow this check to be specialized in the future if
necessary.
This patch also creates a helper function get_task_ioprio which handles the
access check in addition to retrieving the ioprio value for the task.
Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index a5189a347354..51bec4c88f19 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2671,6 +2671,11 @@ static int selinux_task_setioprio(struct task_struct *p, int ioprio) | |||
2671 | return task_has_perm(current, p, PROCESS__SETSCHED); | 2671 | return task_has_perm(current, p, PROCESS__SETSCHED); |
2672 | } | 2672 | } |
2673 | 2673 | ||
2674 | static int selinux_task_getioprio(struct task_struct *p) | ||
2675 | { | ||
2676 | return task_has_perm(current, p, PROCESS__GETSCHED); | ||
2677 | } | ||
2678 | |||
2674 | static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim) | 2679 | static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim) |
2675 | { | 2680 | { |
2676 | struct rlimit *old_rlim = current->signal->rlim + resource; | 2681 | struct rlimit *old_rlim = current->signal->rlim + resource; |
@@ -4449,6 +4454,7 @@ static struct security_operations selinux_ops = { | |||
4449 | .task_setgroups = selinux_task_setgroups, | 4454 | .task_setgroups = selinux_task_setgroups, |
4450 | .task_setnice = selinux_task_setnice, | 4455 | .task_setnice = selinux_task_setnice, |
4451 | .task_setioprio = selinux_task_setioprio, | 4456 | .task_setioprio = selinux_task_setioprio, |
4457 | .task_getioprio = selinux_task_getioprio, | ||
4452 | .task_setrlimit = selinux_task_setrlimit, | 4458 | .task_setrlimit = selinux_task_setrlimit, |
4453 | .task_setscheduler = selinux_task_setscheduler, | 4459 | .task_setscheduler = selinux_task_setscheduler, |
4454 | .task_getscheduler = selinux_task_getscheduler, | 4460 | .task_getscheduler = selinux_task_getscheduler, |