lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  3 Mar 2020 19:30:23 +0100
From:   mateusznosek0@...il.com
To:     linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Cc:     Mateusz Nosek <mateusznosek0@...il.com>, serge@...lyn.com,
        jmorris@...ei.org, john.johansen@...onical.com
Subject: [PATCH] security/apparmor/label.c: Clean code by removing redundant instructions

From: Mateusz Nosek <mateusznosek0@...il.com>

Previously 'label->proxy->label' value checking
and conditional reassigning were done twice in the same function.
The second one is redundant and can be removed.

Signed-off-by: Mateusz Nosek <mateusznosek0@...il.com>
---
 security/apparmor/label.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/security/apparmor/label.c b/security/apparmor/label.c
index ba3987242282..676eebcbfd68 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -311,8 +311,6 @@ int aa_vec_unique(struct aa_profile **vec, int n, int flags)
 
 static void label_destroy(struct aa_label *label)
 {
-	struct aa_label *tmp;
-
 	AA_BUG(!label);
 
 	if (!label_isprofile(label)) {
@@ -333,10 +331,6 @@ static void label_destroy(struct aa_label *label)
 
 	aa_free_secid(label->secid);
 
-	tmp = rcu_dereference_protected(label->proxy->label, true);
-	if (tmp == label)
-		rcu_assign_pointer(label->proxy->label, NULL);
-
 	aa_put_proxy(label->proxy);
 	label->proxy = (struct aa_proxy *) PROXY_POISON + 1;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ