summaryrefslogtreecommitdiff
path: root/include/crypto/akcipher.h
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2018-11-29 14:42:18 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-07 14:15:00 +0800
commit6e8e72cd206e2ba68801e4f2490f639d41808c8d (patch)
tree6c89421ccb76ab0abe12e0d132c4c9a6a9de914b /include/crypto/akcipher.h
parenta6a31385364ca0f7b98ace0bad93d793f07f97f3 (diff)
crypto: user - convert all stats from u32 to u64
All the 32-bit fields need to be 64-bit. In some cases, UINT32_MAX crypto operations can be done in seconds. Reported-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/akcipher.h')
-rw-r--r--include/crypto/akcipher.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h
index afac71119396..3dc05cf7e0a9 100644
--- a/include/crypto/akcipher.h
+++ b/include/crypto/akcipher.h
@@ -278,9 +278,9 @@ static inline void crypto_stat_akcipher_encrypt(struct akcipher_request *req,
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
} else {
- atomic_inc(&tfm->base.__crt_alg->encrypt_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->encrypt_cnt);
atomic64_add(req->src_len, &tfm->base.__crt_alg->encrypt_tlen);
}
#endif
@@ -293,9 +293,9 @@ static inline void crypto_stat_akcipher_decrypt(struct akcipher_request *req,
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
} else {
- atomic_inc(&tfm->base.__crt_alg->decrypt_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->decrypt_cnt);
atomic64_add(req->src_len, &tfm->base.__crt_alg->decrypt_tlen);
}
#endif
@@ -308,9 +308,9 @@ static inline void crypto_stat_akcipher_sign(struct akcipher_request *req,
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
else
- atomic_inc(&tfm->base.__crt_alg->sign_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->sign_cnt);
#endif
}
@@ -321,9 +321,9 @@ static inline void crypto_stat_akcipher_verify(struct akcipher_request *req,
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->akcipher_err_cnt);
else
- atomic_inc(&tfm->base.__crt_alg->verify_cnt);
+ atomic64_inc(&tfm->base.__crt_alg->verify_cnt);
#endif
}