aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/crypto.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/linux/crypto.h
parentcrypto: user - CRYPTO_STATS should depend on CRYPTO_USER (diff)
downloadlinux-dev-6e8e72cd206e2ba68801e4f2490f639d41808c8d.tar.xz
linux-dev-6e8e72cd206e2ba68801e4f2490f639d41808c8d.zip
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/linux/crypto.h')
-rw-r--r--include/linux/crypto.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 3e05053b8d57..b109b50906e7 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -517,11 +517,11 @@ struct crypto_alg {
#ifdef CONFIG_CRYPTO_STATS
union {
- atomic_t encrypt_cnt;
- atomic_t compress_cnt;
- atomic_t generate_cnt;
- atomic_t hash_cnt;
- atomic_t setsecret_cnt;
+ atomic64_t encrypt_cnt;
+ atomic64_t compress_cnt;
+ atomic64_t generate_cnt;
+ atomic64_t hash_cnt;
+ atomic64_t setsecret_cnt;
};
union {
atomic64_t encrypt_tlen;
@@ -530,29 +530,29 @@ struct crypto_alg {
atomic64_t hash_tlen;
};
union {
- atomic_t akcipher_err_cnt;
- atomic_t cipher_err_cnt;
- atomic_t compress_err_cnt;
- atomic_t aead_err_cnt;
- atomic_t hash_err_cnt;
- atomic_t rng_err_cnt;
- atomic_t kpp_err_cnt;
+ atomic64_t akcipher_err_cnt;
+ atomic64_t cipher_err_cnt;
+ atomic64_t compress_err_cnt;
+ atomic64_t aead_err_cnt;
+ atomic64_t hash_err_cnt;
+ atomic64_t rng_err_cnt;
+ atomic64_t kpp_err_cnt;
};
union {
- atomic_t decrypt_cnt;
- atomic_t decompress_cnt;
- atomic_t seed_cnt;
- atomic_t generate_public_key_cnt;
+ atomic64_t decrypt_cnt;
+ atomic64_t decompress_cnt;
+ atomic64_t seed_cnt;
+ atomic64_t generate_public_key_cnt;
};
union {
atomic64_t decrypt_tlen;
atomic64_t decompress_tlen;
};
union {
- atomic_t verify_cnt;
- atomic_t compute_shared_secret_cnt;
+ atomic64_t verify_cnt;
+ atomic64_t compute_shared_secret_cnt;
};
- atomic_t sign_cnt;
+ atomic64_t sign_cnt;
#endif /* CONFIG_CRYPTO_STATS */
} CRYPTO_MINALIGN_ATTR;
@@ -983,9 +983,9 @@ static inline void crypto_stat_ablkcipher_encrypt(struct ablkcipher_request *req
crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic_inc(&crt->base->base.__crt_alg->cipher_err_cnt);
+ atomic64_inc(&crt->base->base.__crt_alg->cipher_err_cnt);
} else {
- atomic_inc(&crt->base->base.__crt_alg->encrypt_cnt);
+ atomic64_inc(&crt->base->base.__crt_alg->encrypt_cnt);
atomic64_add(req->nbytes, &crt->base->base.__crt_alg->encrypt_tlen);
}
#endif
@@ -999,9 +999,9 @@ static inline void crypto_stat_ablkcipher_decrypt(struct ablkcipher_request *req
crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic_inc(&crt->base->base.__crt_alg->cipher_err_cnt);
+ atomic64_inc(&crt->base->base.__crt_alg->cipher_err_cnt);
} else {
- atomic_inc(&crt->base->base.__crt_alg->decrypt_cnt);
+ atomic64_inc(&crt->base->base.__crt_alg->decrypt_cnt);
atomic64_add(req->nbytes, &crt->base->base.__crt_alg->decrypt_tlen);
}
#endif