Skip to content

Commit 348dc28

Browse files
Vishal Goelcschaufler
authored andcommitted
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>
1 parent 3d4f673 commit 348dc28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/smack/smack_lsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3900,7 +3900,7 @@ static struct smack_known *smack_from_secattr(struct netlbl_lsm_secattr *sap,
39003900
* ambient value.
39013901
*/
39023902
rcu_read_lock();
3903-
list_for_each_entry(skp, &smack_known_list, list) {
3903+
list_for_each_entry_rcu(skp, &smack_known_list, list) {
39043904
if (sap->attr.mls.lvl != skp->smk_netlabel.attr.mls.lvl)
39053905
continue;
39063906
/*

0 commit comments

Comments
 (0)