diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-06-01 10:00:05 +0200 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2018-06-01 12:03:08 +0200 |
commit | b5c90a7526fe39164c2204f0404ce8f8ff21e522 (patch) | |
tree | b1b82612e32e0d5a493b6cb1e604642627850723 /security/integrity | |
parent | EVM: prevent array underflow in evm_write_xattrs() (diff) | |
download | linux-b5c90a7526fe39164c2204f0404ce8f8ff21e522.tar.xz linux-b5c90a7526fe39164c2204f0404ce8f8ff21e522.zip |
EVM: unlock on error path in evm_read_xattrs()
We need to unlock before returning on this error path.
Fixes: fa516b66a1bf ("EVM: Allow runtime modification of the set of verified xattrs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity')
-rw-r--r-- | security/integrity/evm/evm_secfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index 3cefef3919e5..637eb999e340 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c @@ -147,8 +147,10 @@ static ssize_t evm_read_xattrs(struct file *filp, char __user *buf, size += strlen(xattr->name) + 1; temp = kmalloc(size + 1, GFP_KERNEL); - if (!temp) + if (!temp) { + mutex_unlock(&xattr_list_mutex); return -ENOMEM; + } list_for_each_entry(xattr, &evm_config_xattrnames, list) { sprintf(temp + offset, "%s\n", xattr->name); |