浏览代码

SELinux: remove unused backpointers from security objects

Remove unused backpoiters from security objects.

Signed-off-by: James Morris <jmorris@namei.org>
James Morris 17 年之前
父节点
当前提交
98e9894650
共有 2 个文件被更改,包括 0 次插入14 次删除
  1. 0 7
      security/selinux/hooks.c
  2. 0 7
      security/selinux/include/objsec.h

+ 0 - 7
security/selinux/hooks.c

@@ -161,7 +161,6 @@ static int task_alloc_security(struct task_struct *task)
 	if (!tsec)
 	if (!tsec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	tsec->task = task;
 	tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED;
 	tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED;
 	task->security = tsec;
 	task->security = tsec;
 
 
@@ -218,7 +217,6 @@ static int file_alloc_security(struct file *file)
 	if (!fsec)
 	if (!fsec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	fsec->file = file;
 	fsec->sid = tsec->sid;
 	fsec->sid = tsec->sid;
 	fsec->fown_sid = tsec->sid;
 	fsec->fown_sid = tsec->sid;
 	file->f_security = fsec;
 	file->f_security = fsec;
@@ -275,7 +273,6 @@ static int sk_alloc_security(struct sock *sk, int family, gfp_t priority)
 	if (!ssec)
 	if (!ssec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	ssec->sk = sk;
 	ssec->peer_sid = SECINITSID_UNLABELED;
 	ssec->peer_sid = SECINITSID_UNLABELED;
 	ssec->sid = SECINITSID_UNLABELED;
 	ssec->sid = SECINITSID_UNLABELED;
 	sk->sk_security = ssec;
 	sk->sk_security = ssec;
@@ -1889,7 +1886,6 @@ static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
 	if (!bsec)
 	if (!bsec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	bsec->bprm = bprm;
 	bsec->sid = SECINITSID_UNLABELED;
 	bsec->sid = SECINITSID_UNLABELED;
 	bsec->set = 0;
 	bsec->set = 0;
 
 
@@ -4561,7 +4557,6 @@ static int ipc_alloc_security(struct task_struct *task,
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	isec->sclass = sclass;
 	isec->sclass = sclass;
-	isec->ipc_perm = perm;
 	isec->sid = tsec->sid;
 	isec->sid = tsec->sid;
 	perm->security = isec;
 	perm->security = isec;
 
 
@@ -4583,7 +4578,6 @@ static int msg_msg_alloc_security(struct msg_msg *msg)
 	if (!msec)
 	if (!msec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	msec->msg = msg;
 	msec->sid = SECINITSID_UNLABELED;
 	msec->sid = SECINITSID_UNLABELED;
 	msg->security = msec;
 	msg->security = msec;
 
 
@@ -5194,7 +5188,6 @@ static int selinux_key_alloc(struct key *k, struct task_struct *tsk,
 	if (!ksec)
 	if (!ksec)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	ksec->obj = k;
 	if (tsec->keycreate_sid)
 	if (tsec->keycreate_sid)
 		ksec->sid = tsec->keycreate_sid;
 		ksec->sid = tsec->keycreate_sid;
 	else
 	else

+ 0 - 7
security/selinux/include/objsec.h

@@ -28,7 +28,6 @@
 #include "avc.h"
 #include "avc.h"
 
 
 struct task_security_struct {
 struct task_security_struct {
-	struct task_struct *task;      /* back pointer to task object */
 	u32 osid;            /* SID prior to last execve */
 	u32 osid;            /* SID prior to last execve */
 	u32 sid;             /* current SID */
 	u32 sid;             /* current SID */
 	u32 exec_sid;        /* exec SID */
 	u32 exec_sid;        /* exec SID */
@@ -50,7 +49,6 @@ struct inode_security_struct {
 };
 };
 
 
 struct file_security_struct {
 struct file_security_struct {
-	struct file *file;              /* back pointer to file object */
 	u32 sid;              /* SID of open file description */
 	u32 sid;              /* SID of open file description */
 	u32 fown_sid;         /* SID of file owner (for SIGIO) */
 	u32 fown_sid;         /* SID of file owner (for SIGIO) */
 	u32 isid;             /* SID of inode at the time of file open */
 	u32 isid;             /* SID of inode at the time of file open */
@@ -73,18 +71,15 @@ struct superblock_security_struct {
 };
 };
 
 
 struct msg_security_struct {
 struct msg_security_struct {
-	struct msg_msg *msg;		/* back pointer */
 	u32 sid;              /* SID of message */
 	u32 sid;              /* SID of message */
 };
 };
 
 
 struct ipc_security_struct {
 struct ipc_security_struct {
-	struct kern_ipc_perm *ipc_perm; /* back pointer */
 	u16 sclass;	/* security class of this object */
 	u16 sclass;	/* security class of this object */
 	u32 sid;              /* SID of IPC resource */
 	u32 sid;              /* SID of IPC resource */
 };
 };
 
 
 struct bprm_security_struct {
 struct bprm_security_struct {
-	struct linux_binprm *bprm;     /* back pointer to bprm object */
 	u32 sid;                       /* SID for transformed process */
 	u32 sid;                       /* SID for transformed process */
 	unsigned char set;
 	unsigned char set;
 
 
@@ -110,7 +105,6 @@ struct netnode_security_struct {
 };
 };
 
 
 struct sk_security_struct {
 struct sk_security_struct {
-	struct sock *sk;		/* back pointer to sk object */
 	u32 sid;			/* SID of this object */
 	u32 sid;			/* SID of this object */
 	u32 peer_sid;			/* SID of peer */
 	u32 peer_sid;			/* SID of peer */
 	u16 sclass;			/* sock security class */
 	u16 sclass;			/* sock security class */
@@ -124,7 +118,6 @@ struct sk_security_struct {
 };
 };
 
 
 struct key_security_struct {
 struct key_security_struct {
-	struct key *obj; /* back pointer */
 	u32 sid;         /* SID of key */
 	u32 sid;         /* SID of key */
 };
 };