diff options
author | Christoph Hellwig <hch@lst.de> | 2017-09-01 11:39:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-04 19:05:15 -0400 |
commit | bdd1d2d3d251c65b74ac4493e08db18971c09240 (patch) | |
tree | 71df247eeb367203c59a26eed8a384398c2d8131 /security/keys | |
parent | c41fbad015dabb0a40ecca50c3ff5658eb6471ff (diff) |
fs: fix kernel_read prototype
Use proper ssize_t and size_t types for the return value and count
argument, move the offset last and make it an in/out argument like
all other read/write helpers, and make the buf argument a void pointer
to get rid of lots of casts in the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/keys')
-rw-r--r-- | security/keys/big_key.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/keys/big_key.c b/security/keys/big_key.c index 835c1ab30d01..9f4c86cade8e 100644 --- a/security/keys/big_key.c +++ b/security/keys/big_key.c | |||
@@ -295,6 +295,7 @@ long big_key_read(const struct key *key, char __user *buffer, size_t buflen) | |||
295 | u8 *data; | 295 | u8 *data; |
296 | u8 *enckey = (u8 *)key->payload.data[big_key_data]; | 296 | u8 *enckey = (u8 *)key->payload.data[big_key_data]; |
297 | size_t enclen = ALIGN(datalen, crypto_skcipher_blocksize(big_key_skcipher)); | 297 | size_t enclen = ALIGN(datalen, crypto_skcipher_blocksize(big_key_skcipher)); |
298 | loff_t pos = 0; | ||
298 | 299 | ||
299 | data = kmalloc(enclen, GFP_KERNEL); | 300 | data = kmalloc(enclen, GFP_KERNEL); |
300 | if (!data) | 301 | if (!data) |
@@ -307,7 +308,7 @@ long big_key_read(const struct key *key, char __user *buffer, size_t buflen) | |||
307 | } | 308 | } |
308 | 309 | ||
309 | /* read file to kernel and decrypt */ | 310 | /* read file to kernel and decrypt */ |
310 | ret = kernel_read(file, 0, data, enclen); | 311 | ret = kernel_read(file, data, enclen, &pos); |
311 | if (ret >= 0 && ret != enclen) { | 312 | if (ret >= 0 && ret != enclen) { |
312 | ret = -EIO; | 313 | ret = -EIO; |
313 | goto err_fput; | 314 | goto err_fput; |