diff mbox series

[1/2] selinux: avoid identifier using reserved name

Message ID 20240315173105.636749-2-cgzones@googlemail.com (mailing list archive)
State Rejected
Delegated to: Paul Moore
Headers show
Series [1/2] selinux: avoid identifier using reserved name | expand

Commit Message

Christian Göttsche March 15, 2024, 5:31 p.m. UTC
Avoid using an identifier starting with double underscores, which
signals a reserved identifier.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 security/selinux/hooks.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Paul Moore March 26, 2024, 8:39 p.m. UTC | #1
On Fri, Mar 15, 2024 at 1:31 PM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> Avoid using an identifier starting with double underscores, which
> signals a reserved identifier.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
>  security/selinux/hooks.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

Thank you for the patch, but this was addressed by the patch below
which was posted on February 23rd.

https://lore.kernel.org/selinux/20240223212640.305789-2-paul@paul-moore.com
diff mbox series

Patch

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index a0fde0641f77..f9a61ff64b83 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -6347,16 +6347,16 @@  static void selinux_d_instantiate(struct dentry *dentry, struct inode *inode)
 static int selinux_lsm_getattr(unsigned int attr, struct task_struct *p,
 			       char **value)
 {
-	const struct task_security_struct *__tsec;
+	const struct task_security_struct *tsec;
 	u32 sid;
 	int error;
 	unsigned len;
 
 	rcu_read_lock();
-	__tsec = selinux_cred(__task_cred(p));
+	tsec = selinux_cred(__task_cred(p));
 
 	if (current != p) {
-		error = avc_has_perm(current_sid(), __tsec->sid,
+		error = avc_has_perm(current_sid(), tsec->sid,
 				     SECCLASS_PROCESS, PROCESS__GETATTR, NULL);
 		if (error)
 			goto bad;
@@ -6364,22 +6364,22 @@  static int selinux_lsm_getattr(unsigned int attr, struct task_struct *p,
 
 	switch (attr) {
 	case LSM_ATTR_CURRENT:
-		sid = __tsec->sid;
+		sid = tsec->sid;
 		break;
 	case LSM_ATTR_PREV:
-		sid = __tsec->osid;
+		sid = tsec->osid;
 		break;
 	case LSM_ATTR_EXEC:
-		sid = __tsec->exec_sid;
+		sid = tsec->exec_sid;
 		break;
 	case LSM_ATTR_FSCREATE:
-		sid = __tsec->create_sid;
+		sid = tsec->create_sid;
 		break;
 	case LSM_ATTR_KEYCREATE:
-		sid = __tsec->keycreate_sid;
+		sid = tsec->keycreate_sid;
 		break;
 	case LSM_ATTR_SOCKCREATE:
-		sid = __tsec->sockcreate_sid;
+		sid = tsec->sockcreate_sid;
 		break;
 	default:
 		error = -EOPNOTSUPP;