diff options
author | James Morris <james.l.morris@oracle.com> | 2015-12-26 16:06:53 +1100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2015-12-26 16:06:53 +1100 |
commit | 3cb92fe48138d225b8d0ceedf148642f9103f841 (patch) | |
tree | cbb877002d9d39777be13df3876e05f2542da234 /security/integrity/evm/evm_secfs.c | |
parent | 5beb0c435bdde35a09376566b0e28f7df87c9f68 (diff) | |
parent | 0112721df4edbdd07b800813300d76811572f080 (diff) | |
download | talos-obmc-linux-3cb92fe48138d225b8d0ceedf148642f9103f841.tar.gz talos-obmc-linux-3cb92fe48138d225b8d0ceedf148642f9103f841.zip |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity into next
Diffstat (limited to 'security/integrity/evm/evm_secfs.c')
-rw-r--r-- | security/integrity/evm/evm_secfs.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c index cf12a04717d3..c8dccd54d501 100644 --- a/security/integrity/evm/evm_secfs.c +++ b/security/integrity/evm/evm_secfs.c @@ -62,9 +62,9 @@ static ssize_t evm_write_key(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { char temp[80]; - int i, error; + int i; - if (!capable(CAP_SYS_ADMIN) || evm_initialized) + if (!capable(CAP_SYS_ADMIN) || (evm_initialized & EVM_INIT_HMAC)) return -EPERM; if (count >= sizeof(temp) || count == 0) @@ -78,12 +78,8 @@ static ssize_t evm_write_key(struct file *file, const char __user *buf, if ((sscanf(temp, "%d", &i) != 1) || (i != 1)) return -EINVAL; - error = evm_init_key(); - if (!error) { - evm_initialized = 1; - pr_info("initialized\n"); - } else - pr_err("initialization failed\n"); + evm_init_key(); + return count; } |