diff options
author | James Morris <james.l.morris@oracle.com> | 2017-01-27 01:23:21 +0300 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2017-01-27 01:23:21 +0300 |
commit | 710584b9daefe25a2b5dc2c6c10dbb00e1b3b451 (patch) | |
tree | 009861b1deb7839b99ca3c39de98e85b943da3f4 /security/smack/smackfs.c | |
parent | c659af78eb7b7d7be40f23d9d97bde58eb1368ac (diff) | |
parent | 83a1e53f392075e291a90746241dce45c6f9429a (diff) | |
download | linux-710584b9daefe25a2b5dc2c6c10dbb00e1b3b451.tar.xz |
Merge branch 'smack-for-4.11' of git://github.com/cschaufler/smack-next into next
Diffstat (limited to 'security/smack/smackfs.c')
-rw-r--r-- | security/smack/smackfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 13743a01b35b..366b8356f75b 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -67,6 +67,7 @@ enum smk_inos { /* * List locks */ +static DEFINE_MUTEX(smack_master_list_lock); static DEFINE_MUTEX(smack_cipso_lock); static DEFINE_MUTEX(smack_ambient_lock); static DEFINE_MUTEX(smk_net4addr_lock); @@ -262,12 +263,16 @@ static int smk_set_access(struct smack_parsed_rule *srp, * it needs to get added for reporting. */ if (global) { + mutex_unlock(rule_lock); smlp = kzalloc(sizeof(*smlp), GFP_KERNEL); if (smlp != NULL) { smlp->smk_rule = sp; + mutex_lock(&smack_master_list_lock); list_add_rcu(&smlp->list, &smack_rule_list); + mutex_unlock(&smack_master_list_lock); } else rc = -ENOMEM; + return rc; } } |