diff options
author | David Quigley <dpquigl@tycho.nsa.gov> | 2006-06-30 04:55:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 14:25:36 -0400 |
commit | f9008e4c5c525941967b67777945aa6266ab6326 (patch) | |
tree | a0c9436485b80d548ef74d5f1aec0f6d0309af6e /include | |
parent | ed11d9eb2228acc483c819ab353e3c41bcb158fa (diff) |
[PATCH] SELinux: extend task_kill hook to handle signals sent by AIO completion
This patch extends the security_task_kill hook to handle signals sent by AIO
completion. In this case, the secid of the task responsible for the signal
needs to be obtained and saved earlier, so a security_task_getsecid() hook is
added, and then this saved value is passed subsequently to the extended
task_kill hook for use in checking.
Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/security.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index c7ea15716dce..d4b13d617f63 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -567,6 +567,9 @@ struct swap_info_struct; | |||
567 | * @p. | 567 | * @p. |
568 | * @p contains the task_struct for the process. | 568 | * @p contains the task_struct for the process. |
569 | * Return 0 if permission is granted. | 569 | * Return 0 if permission is granted. |
570 | * @task_getsecid: | ||
571 | * Retrieve the security identifier of the process @p. | ||
572 | * @p contains the task_struct for the process and place is into @secid. | ||
570 | * @task_setgroups: | 573 | * @task_setgroups: |
571 | * Check permission before setting the supplementary group set of the | 574 | * Check permission before setting the supplementary group set of the |
572 | * current process. | 575 | * current process. |
@@ -615,6 +618,7 @@ struct swap_info_struct; | |||
615 | * @p contains the task_struct for process. | 618 | * @p contains the task_struct for process. |
616 | * @info contains the signal information. | 619 | * @info contains the signal information. |
617 | * @sig contains the signal value. | 620 | * @sig contains the signal value. |
621 | * @secid contains the sid of the process where the signal originated | ||
618 | * Return 0 if permission is granted. | 622 | * Return 0 if permission is granted. |
619 | * @task_wait: | 623 | * @task_wait: |
620 | * Check permission before allowing a process to reap a child process @p | 624 | * Check permission before allowing a process to reap a child process @p |
@@ -1219,6 +1223,7 @@ struct security_operations { | |||
1219 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); | 1223 | int (*task_setpgid) (struct task_struct * p, pid_t pgid); |
1220 | int (*task_getpgid) (struct task_struct * p); | 1224 | int (*task_getpgid) (struct task_struct * p); |
1221 | int (*task_getsid) (struct task_struct * p); | 1225 | int (*task_getsid) (struct task_struct * p); |
1226 | void (*task_getsecid) (struct task_struct * p, u32 * secid); | ||
1222 | int (*task_setgroups) (struct group_info *group_info); | 1227 | int (*task_setgroups) (struct group_info *group_info); |
1223 | int (*task_setnice) (struct task_struct * p, int nice); | 1228 | int (*task_setnice) (struct task_struct * p, int nice); |
1224 | int (*task_setioprio) (struct task_struct * p, int ioprio); | 1229 | int (*task_setioprio) (struct task_struct * p, int ioprio); |
@@ -1228,7 +1233,7 @@ struct security_operations { | |||
1228 | int (*task_getscheduler) (struct task_struct * p); | 1233 | int (*task_getscheduler) (struct task_struct * p); |
1229 | int (*task_movememory) (struct task_struct * p); | 1234 | int (*task_movememory) (struct task_struct * p); |
1230 | int (*task_kill) (struct task_struct * p, | 1235 | int (*task_kill) (struct task_struct * p, |
1231 | struct siginfo * info, int sig); | 1236 | struct siginfo * info, int sig, u32 secid); |
1232 | int (*task_wait) (struct task_struct * p); | 1237 | int (*task_wait) (struct task_struct * p); |
1233 | int (*task_prctl) (int option, unsigned long arg2, | 1238 | int (*task_prctl) (int option, unsigned long arg2, |
1234 | unsigned long arg3, unsigned long arg4, | 1239 | unsigned long arg3, unsigned long arg4, |
@@ -1839,6 +1844,11 @@ static inline int security_task_getsid (struct task_struct *p) | |||
1839 | return security_ops->task_getsid (p); | 1844 | return security_ops->task_getsid (p); |
1840 | } | 1845 | } |
1841 | 1846 | ||
1847 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
1848 | { | ||
1849 | security_ops->task_getsecid (p, secid); | ||
1850 | } | ||
1851 | |||
1842 | static inline int security_task_setgroups (struct group_info *group_info) | 1852 | static inline int security_task_setgroups (struct group_info *group_info) |
1843 | { | 1853 | { |
1844 | return security_ops->task_setgroups (group_info); | 1854 | return security_ops->task_setgroups (group_info); |
@@ -1878,9 +1888,10 @@ static inline int security_task_movememory (struct task_struct *p) | |||
1878 | } | 1888 | } |
1879 | 1889 | ||
1880 | static inline int security_task_kill (struct task_struct *p, | 1890 | static inline int security_task_kill (struct task_struct *p, |
1881 | struct siginfo *info, int sig) | 1891 | struct siginfo *info, int sig, |
1892 | u32 secid) | ||
1882 | { | 1893 | { |
1883 | return security_ops->task_kill (p, info, sig); | 1894 | return security_ops->task_kill (p, info, sig, secid); |
1884 | } | 1895 | } |
1885 | 1896 | ||
1886 | static inline int security_task_wait (struct task_struct *p) | 1897 | static inline int security_task_wait (struct task_struct *p) |
@@ -2491,6 +2502,9 @@ static inline int security_task_getsid (struct task_struct *p) | |||
2491 | return 0; | 2502 | return 0; |
2492 | } | 2503 | } |
2493 | 2504 | ||
2505 | static inline void security_task_getsecid (struct task_struct *p, u32 *secid) | ||
2506 | { } | ||
2507 | |||
2494 | static inline int security_task_setgroups (struct group_info *group_info) | 2508 | static inline int security_task_setgroups (struct group_info *group_info) |
2495 | { | 2509 | { |
2496 | return 0; | 2510 | return 0; |
@@ -2530,7 +2544,8 @@ static inline int security_task_movememory (struct task_struct *p) | |||
2530 | } | 2544 | } |
2531 | 2545 | ||
2532 | static inline int security_task_kill (struct task_struct *p, | 2546 | static inline int security_task_kill (struct task_struct *p, |
2533 | struct siginfo *info, int sig) | 2547 | struct siginfo *info, int sig, |
2548 | u32 secid) | ||
2534 | { | 2549 | { |
2535 | return 0; | 2550 | return 0; |
2536 | } | 2551 | } |