Skip to content

Commit 98e9894

Browse files
committed
SELinux: remove unused backpointers from security objects
Remove unused backpoiters from security objects. Signed-off-by: James Morris <jmorris@namei.org>
1 parent f74af6e commit 98e9894

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

‎security/selinux/hooks.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ static int task_alloc_security(struct task_struct *task)
161161
if (!tsec)
162162
return -ENOMEM;
163163

164-
tsec->task = task;
165164
tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED;
166165
task->security = tsec;
167166

@@ -218,7 +217,6 @@ static int file_alloc_security(struct file *file)
218217
if (!fsec)
219218
return -ENOMEM;
220219

221-
fsec->file = file;
222220
fsec->sid = tsec->sid;
223221
fsec->fown_sid = tsec->sid;
224222
file->f_security = fsec;
@@ -275,7 +273,6 @@ static int sk_alloc_security(struct sock *sk, int family, gfp_t priority)
275273
if (!ssec)
276274
return -ENOMEM;
277275

278-
ssec->sk = sk;
279276
ssec->peer_sid = SECINITSID_UNLABELED;
280277
ssec->sid = SECINITSID_UNLABELED;
281278
sk->sk_security = ssec;
@@ -1889,7 +1886,6 @@ static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
18891886
if (!bsec)
18901887
return -ENOMEM;
18911888

1892-
bsec->bprm = bprm;
18931889
bsec->sid = SECINITSID_UNLABELED;
18941890
bsec->set = 0;
18951891

@@ -4561,7 +4557,6 @@ static int ipc_alloc_security(struct task_struct *task,
45614557
return -ENOMEM;
45624558

45634559
isec->sclass = sclass;
4564-
isec->ipc_perm = perm;
45654560
isec->sid = tsec->sid;
45664561
perm->security = isec;
45674562

@@ -4583,7 +4578,6 @@ static int msg_msg_alloc_security(struct msg_msg *msg)
45834578
if (!msec)
45844579
return -ENOMEM;
45854580

4586-
msec->msg = msg;
45874581
msec->sid = SECINITSID_UNLABELED;
45884582
msg->security = msec;
45894583

@@ -5194,7 +5188,6 @@ static int selinux_key_alloc(struct key *k, struct task_struct *tsk,
51945188
if (!ksec)
51955189
return -ENOMEM;
51965190

5197-
ksec->obj = k;
51985191
if (tsec->keycreate_sid)
51995192
ksec->sid = tsec->keycreate_sid;
52005193
else

‎security/selinux/include/objsec.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "avc.h"
2929

3030
struct task_security_struct {
31-
struct task_struct *task; /* back pointer to task object */
3231
u32 osid; /* SID prior to last execve */
3332
u32 sid; /* current SID */
3433
u32 exec_sid; /* exec SID */
@@ -50,7 +49,6 @@ struct inode_security_struct {
5049
};
5150

5251
struct file_security_struct {
53-
struct file *file; /* back pointer to file object */
5452
u32 sid; /* SID of open file description */
5553
u32 fown_sid; /* SID of file owner (for SIGIO) */
5654
u32 isid; /* SID of inode at the time of file open */
@@ -73,18 +71,15 @@ struct superblock_security_struct {
7371
};
7472

7573
struct msg_security_struct {
76-
struct msg_msg *msg; /* back pointer */
7774
u32 sid; /* SID of message */
7875
};
7976

8077
struct ipc_security_struct {
81-
struct kern_ipc_perm *ipc_perm; /* back pointer */
8278
u16 sclass; /* security class of this object */
8379
u32 sid; /* SID of IPC resource */
8480
};
8581

8682
struct bprm_security_struct {
87-
struct linux_binprm *bprm; /* back pointer to bprm object */
8883
u32 sid; /* SID for transformed process */
8984
unsigned char set;
9085

@@ -110,7 +105,6 @@ struct netnode_security_struct {
110105
};
111106

112107
struct sk_security_struct {
113-
struct sock *sk; /* back pointer to sk object */
114108
u32 sid; /* SID of this object */
115109
u32 peer_sid; /* SID of peer */
116110
u16 sclass; /* sock security class */
@@ -124,7 +118,6 @@ struct sk_security_struct {
124118
};
125119

126120
struct key_security_struct {
127-
struct key *obj; /* back pointer */
128121
u32 sid; /* SID of key */
129122
};
130123

0 commit comments

Comments
 (0)