aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-02-25 17:52:58 -0500
committerJames Morris <jmorris@namei.org>2008-04-18 06:26:04 -0400
commit98e9894650455426f67c2157db4f39bd14fac2f6 (patch)
treebee5205f20c4d1faa6ec80f05d708eecad2959b3 /security/selinux
parentf74af6e816c940c678c235d49486fe40d7e49ce9 (diff)
SELinux: remove unused backpointers from security objects
Remove unused backpoiters from security objects. Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c7
-rw-r--r--security/selinux/include/objsec.h7
2 files changed, 0 insertions, 14 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index d51bd40a04a8..710894d4841b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -161,7 +161,6 @@ static int task_alloc_security(struct task_struct *task)
161 if (!tsec) 161 if (!tsec)
162 return -ENOMEM; 162 return -ENOMEM;
163 163
164 tsec->task = task;
165 tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED; 164 tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED;
166 task->security = tsec; 165 task->security = tsec;
167 166
@@ -218,7 +217,6 @@ static int file_alloc_security(struct file *file)
218 if (!fsec) 217 if (!fsec)
219 return -ENOMEM; 218 return -ENOMEM;
220 219
221 fsec->file = file;
222 fsec->sid = tsec->sid; 220 fsec->sid = tsec->sid;
223 fsec->fown_sid = tsec->sid; 221 fsec->fown_sid = tsec->sid;
224 file->f_security = fsec; 222 file->f_security = fsec;
@@ -275,7 +273,6 @@ static int sk_alloc_security(struct sock *sk, int family, gfp_t priority)
275 if (!ssec) 273 if (!ssec)
276 return -ENOMEM; 274 return -ENOMEM;
277 275
278 ssec->sk = sk;
279 ssec->peer_sid = SECINITSID_UNLABELED; 276 ssec->peer_sid = SECINITSID_UNLABELED;
280 ssec->sid = SECINITSID_UNLABELED; 277 ssec->sid = SECINITSID_UNLABELED;
281 sk->sk_security = ssec; 278 sk->sk_security = ssec;
@@ -1889,7 +1886,6 @@ static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
1889 if (!bsec) 1886 if (!bsec)
1890 return -ENOMEM; 1887 return -ENOMEM;
1891 1888
1892 bsec->bprm = bprm;
1893 bsec->sid = SECINITSID_UNLABELED; 1889 bsec->sid = SECINITSID_UNLABELED;
1894 bsec->set = 0; 1890 bsec->set = 0;
1895 1891
@@ -4561,7 +4557,6 @@ static int ipc_alloc_security(struct task_struct *task,
4561 return -ENOMEM; 4557 return -ENOMEM;
4562 4558
4563 isec->sclass = sclass; 4559 isec->sclass = sclass;
4564 isec->ipc_perm = perm;
4565 isec->sid = tsec->sid; 4560 isec->sid = tsec->sid;
4566 perm->security = isec; 4561 perm->security = isec;
4567 4562
@@ -4583,7 +4578,6 @@ static int msg_msg_alloc_security(struct msg_msg *msg)
4583 if (!msec) 4578 if (!msec)
4584 return -ENOMEM; 4579 return -ENOMEM;
4585 4580
4586 msec->msg = msg;
4587 msec->sid = SECINITSID_UNLABELED; 4581 msec->sid = SECINITSID_UNLABELED;
4588 msg->security = msec; 4582 msg->security = msec;
4589 4583
@@ -5194,7 +5188,6 @@ static int selinux_key_alloc(struct key *k, struct task_struct *tsk,
5194 if (!ksec) 5188 if (!ksec)
5195 return -ENOMEM; 5189 return -ENOMEM;
5196 5190
5197 ksec->obj = k;
5198 if (tsec->keycreate_sid) 5191 if (tsec->keycreate_sid)
5199 ksec->sid = tsec->keycreate_sid; 5192 ksec->sid = tsec->keycreate_sid;
5200 else 5193 else
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index 0b74077eed4f..020a8754b809 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -28,7 +28,6 @@
28#include "avc.h" 28#include "avc.h"
29 29
30struct task_security_struct { 30struct task_security_struct {
31 struct task_struct *task; /* back pointer to task object */
32 u32 osid; /* SID prior to last execve */ 31 u32 osid; /* SID prior to last execve */
33 u32 sid; /* current SID */ 32 u32 sid; /* current SID */
34 u32 exec_sid; /* exec SID */ 33 u32 exec_sid; /* exec SID */
@@ -50,7 +49,6 @@ struct inode_security_struct {
50}; 49};
51 50
52struct file_security_struct { 51struct file_security_struct {
53 struct file *file; /* back pointer to file object */
54 u32 sid; /* SID of open file description */ 52 u32 sid; /* SID of open file description */
55 u32 fown_sid; /* SID of file owner (for SIGIO) */ 53 u32 fown_sid; /* SID of file owner (for SIGIO) */
56 u32 isid; /* SID of inode at the time of file open */ 54 u32 isid; /* SID of inode at the time of file open */
@@ -73,18 +71,15 @@ struct superblock_security_struct {
73}; 71};
74 72
75struct msg_security_struct { 73struct msg_security_struct {
76 struct msg_msg *msg; /* back pointer */
77 u32 sid; /* SID of message */ 74 u32 sid; /* SID of message */
78}; 75};
79 76
80struct ipc_security_struct { 77struct ipc_security_struct {
81 struct kern_ipc_perm *ipc_perm; /* back pointer */
82 u16 sclass; /* security class of this object */ 78 u16 sclass; /* security class of this object */
83 u32 sid; /* SID of IPC resource */ 79 u32 sid; /* SID of IPC resource */
84}; 80};
85 81
86struct bprm_security_struct { 82struct bprm_security_struct {
87 struct linux_binprm *bprm; /* back pointer to bprm object */
88 u32 sid; /* SID for transformed process */ 83 u32 sid; /* SID for transformed process */
89 unsigned char set; 84 unsigned char set;
90 85
@@ -110,7 +105,6 @@ struct netnode_security_struct {
110}; 105};
111 106
112struct sk_security_struct { 107struct sk_security_struct {
113 struct sock *sk; /* back pointer to sk object */
114 u32 sid; /* SID of this object */ 108 u32 sid; /* SID of this object */
115 u32 peer_sid; /* SID of peer */ 109 u32 peer_sid; /* SID of peer */
116 u16 sclass; /* sock security class */ 110 u16 sclass; /* sock security class */
@@ -124,7 +118,6 @@ struct sk_security_struct {
124}; 118};
125 119
126struct key_security_struct { 120struct key_security_struct {
127 struct key *obj; /* back pointer */
128 u32 sid; /* SID of key */ 121 u32 sid; /* SID of key */
129}; 122};
130 123