diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2010-10-14 15:21:18 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-10-20 19:12:44 -0400 |
commit | b0ae19811375031ae3b3fecc65b702a9c6e5cc28 (patch) | |
tree | a765b71155fbed1ed3a3cff35c1044ad49a002ae /security | |
parent | 9b3056cca09529d34af2d81305b2a9c6b622ca1b (diff) |
security: remove unused parameter from security_task_setscheduler()
All security modules shouldn't change sched_param parameter of
security_task_setscheduler(). This is not only meaningless, but also
make a harmful result if caller pass a static variable.
This patch remove policy and sched_param parameter from
security_task_setscheduler() becuase none of security module is
using it.
Cc: James Morris <jmorris@namei.org>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/commoncap.c | 5 | ||||
-rw-r--r-- | security/security.c | 5 | ||||
-rw-r--r-- | security/selinux/hooks.c | 4 | ||||
-rw-r--r-- | security/smack/smack_lsm.c | 5 |
4 files changed, 7 insertions, 12 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index 9d172e6e330c..5e632b4857e4 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -719,14 +719,11 @@ static int cap_safe_nice(struct task_struct *p) | |||
719 | /** | 719 | /** |
720 | * cap_task_setscheduler - Detemine if scheduler policy change is permitted | 720 | * cap_task_setscheduler - Detemine if scheduler policy change is permitted |
721 | * @p: The task to affect | 721 | * @p: The task to affect |
722 | * @policy: The policy to effect | ||
723 | * @lp: The parameters to the scheduling policy | ||
724 | * | 722 | * |
725 | * Detemine if the requested scheduler policy change is permitted for the | 723 | * Detemine if the requested scheduler policy change is permitted for the |
726 | * specified task, returning 0 if permission is granted, -ve if denied. | 724 | * specified task, returning 0 if permission is granted, -ve if denied. |
727 | */ | 725 | */ |
728 | int cap_task_setscheduler(struct task_struct *p, int policy, | 726 | int cap_task_setscheduler(struct task_struct *p) |
729 | struct sched_param *lp) | ||
730 | { | 727 | { |
731 | return cap_safe_nice(p); | 728 | return cap_safe_nice(p); |
732 | } | 729 | } |
diff --git a/security/security.c b/security/security.c index 43b6463ebbfb..1cbcdfa4b015 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -778,10 +778,9 @@ int security_task_setrlimit(struct task_struct *p, unsigned int resource, | |||
778 | return security_ops->task_setrlimit(p, resource, new_rlim); | 778 | return security_ops->task_setrlimit(p, resource, new_rlim); |
779 | } | 779 | } |
780 | 780 | ||
781 | int security_task_setscheduler(struct task_struct *p, | 781 | int security_task_setscheduler(struct task_struct *p) |
782 | int policy, struct sched_param *lp) | ||
783 | { | 782 | { |
784 | return security_ops->task_setscheduler(p, policy, lp); | 783 | return security_ops->task_setscheduler(p); |
785 | } | 784 | } |
786 | 785 | ||
787 | int security_task_getscheduler(struct task_struct *p) | 786 | int security_task_getscheduler(struct task_struct *p) |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4796ddd4e721..db2b331de89a 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -3354,11 +3354,11 @@ static int selinux_task_setrlimit(struct task_struct *p, unsigned int resource, | |||
3354 | return 0; | 3354 | return 0; |
3355 | } | 3355 | } |
3356 | 3356 | ||
3357 | static int selinux_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp) | 3357 | static int selinux_task_setscheduler(struct task_struct *p) |
3358 | { | 3358 | { |
3359 | int rc; | 3359 | int rc; |
3360 | 3360 | ||
3361 | rc = cap_task_setscheduler(p, policy, lp); | 3361 | rc = cap_task_setscheduler(p); |
3362 | if (rc) | 3362 | if (rc) |
3363 | return rc; | 3363 | return rc; |
3364 | 3364 | ||
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index c448d57ae2b7..174aec44bfac 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -1281,12 +1281,11 @@ static int smack_task_getioprio(struct task_struct *p) | |||
1281 | * | 1281 | * |
1282 | * Return 0 if read access is permitted | 1282 | * Return 0 if read access is permitted |
1283 | */ | 1283 | */ |
1284 | static int smack_task_setscheduler(struct task_struct *p, int policy, | 1284 | static int smack_task_setscheduler(struct task_struct *p) |
1285 | struct sched_param *lp) | ||
1286 | { | 1285 | { |
1287 | int rc; | 1286 | int rc; |
1288 | 1287 | ||
1289 | rc = cap_task_setscheduler(p, policy, lp); | 1288 | rc = cap_task_setscheduler(p); |
1290 | if (rc == 0) | 1289 | if (rc == 0) |
1291 | rc = smk_curacc_on_task(p, MAY_WRITE); | 1290 | rc = smk_curacc_on_task(p, MAY_WRITE); |
1292 | return rc; | 1291 | return rc; |