aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/big_key.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-21 09:37:13 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-21 09:37:13 -0400
commit3bda03865fcaf5e30248bf4b7b37a81f6966caf9 (patch)
tree40e1edb696326bfbd028afc271e7272d87b6b506 /security/keys/big_key.c
parentkvm: Disable objtool frame pointer checking for vmenter.S (diff)
parentMAINTAINERS: add a reviewer for KVM/s390 (diff)
downloadlinux-dev-3bda03865fcaf5e30248bf4b7b37a81f6966caf9.tar.xz
linux-dev-3bda03865fcaf5e30248bf4b7b37a81f6966caf9.zip
Merge tag 'kvm-s390-master-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master
KVM: s390: Fix for 5.7 and maintainer update - Silence false positive lockdep warning - add Claudio as reviewer
Diffstat (limited to 'security/keys/big_key.c')
-rw-r--r--security/keys/big_key.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/security/keys/big_key.c b/security/keys/big_key.c
index 001abe530a0d..82008f900930 100644
--- a/security/keys/big_key.c
+++ b/security/keys/big_key.c
@@ -352,7 +352,7 @@ void big_key_describe(const struct key *key, struct seq_file *m)
* read the key data
* - the key's semaphore is read-locked
*/
-long big_key_read(const struct key *key, char __user *buffer, size_t buflen)
+long big_key_read(const struct key *key, char *buffer, size_t buflen)
{
size_t datalen = (size_t)key->payload.data[big_key_len];
long ret;
@@ -391,9 +391,8 @@ long big_key_read(const struct key *key, char __user *buffer, size_t buflen)
ret = datalen;
- /* copy decrypted data to user */
- if (copy_to_user(buffer, buf->virt, datalen) != 0)
- ret = -EFAULT;
+ /* copy out decrypted data */
+ memcpy(buffer, buf->virt, datalen);
err_fput:
fput(file);
@@ -401,9 +400,7 @@ error:
big_key_free_buffer(buf);
} else {
ret = datalen;
- if (copy_to_user(buffer, key->payload.data[big_key_data],
- datalen) != 0)
- ret = -EFAULT;
+ memcpy(buffer, key->payload.data[big_key_data], datalen);
}
return ret;