summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Goel <vishal.goel@samsung.com>2016-11-23 06:15:31 +0100
committerCasey Schaufler <casey@schaufler-ca.com>2017-01-10 18:47:20 +0100
commit348dc288d4bf4c0272a46a80f97748f36916601b (patch)
treea95c23588984356c64a58c444b92e238718f59b5
parentSMACK: Free the i_security blob in inode using RCU (diff)
downloadlinux-348dc288d4bf4c0272a46a80f97748f36916601b.tar.xz
linux-348dc288d4bf4c0272a46a80f97748f36916601b.zip
Smack: Traverse the smack_known_list using list_for_each_entry_rcu macro
In smack_from_secattr function,"smack_known_list" is being traversed using list_for_each_entry macro, although it is a rcu protected structure. So it should be traversed using "list_for_each_entry_rcu" macro to fetch the rcu protected entry. Signed-off-by: Vishal Goel <vishal.goel@samsung.com> Signed-off-by: Himanshu Shukla <himanshu.sh@samsung.com> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
-rw-r--r--security/smack/smack_lsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 5deda8e0fe96..4dd458a2b1e8 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3900,7 +3900,7 @@ static struct smack_known *smack_from_secattr(struct netlbl_lsm_secattr *sap,
* ambient value.
*/
rcu_read_lock();
- list_for_each_entry(skp, &smack_known_list, list) {
+ list_for_each_entry_rcu(skp, &smack_known_list, list) {
if (sap->attr.mls.lvl != skp->smk_netlabel.attr.mls.lvl)
continue;
/*