mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[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 <[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: James Morris <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7a01955f99
commit
a1836a42da
4 changed files with 51 additions and 5 deletions
|
|
@ -524,6 +524,11 @@ static int dummy_task_setioprio (struct task_struct *p, int ioprio)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_task_getioprio (struct task_struct *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_task_setrlimit (unsigned int resource, struct rlimit *new_rlim)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -988,6 +993,7 @@ void security_fixup_ops (struct security_operations *ops)
|
|||
set_to_dummy_if_null(ops, task_setgroups);
|
||||
set_to_dummy_if_null(ops, task_setnice);
|
||||
set_to_dummy_if_null(ops, task_setioprio);
|
||||
set_to_dummy_if_null(ops, task_getioprio);
|
||||
set_to_dummy_if_null(ops, task_setrlimit);
|
||||
set_to_dummy_if_null(ops, task_setscheduler);
|
||||
set_to_dummy_if_null(ops, task_getscheduler);
|
||||
|
|
|
|||
Loading…
Reference in a new issue