summaryrefslogtreecommitdiffstats
path: root/include/linux/crypto.h
diff options
context:
space:
mode:
authorEric Biggers2017-12-29 17:00:46 +0100
committerHerbert Xu2018-01-05 08:43:09 +0100
commitce8614a312ef750bb60677bb13680cb27d1c284b (patch)
tree842f01d86dc235bcd80c8544969d9fffeaec30c5 /include/linux/crypto.h
parentcrypto: inside-secure - fix hash when length is a multiple of a block (diff)
downloadkernel-qcow2-linux-ce8614a312ef750bb60677bb13680cb27d1c284b.tar.gz
kernel-qcow2-linux-ce8614a312ef750bb60677bb13680cb27d1c284b.tar.xz
kernel-qcow2-linux-ce8614a312ef750bb60677bb13680cb27d1c284b.zip
crypto: algapi - convert cra_refcnt to refcount_t
Reference counters should use refcount_t rather than atomic_t, since the refcount_t implementation can prevent overflows, reducing the exploitability of reference leak bugs. crypto_alg.cra_refcount is a reference counter with the usual semantics, so switch it over to refcount_t. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/crypto.h')
-rw-r--r--include/linux/crypto.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 78508ca4b108..231e59f90d32 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -447,7 +447,7 @@ struct crypto_alg {
unsigned int cra_alignmask;
int cra_priority;
- atomic_t cra_refcnt;
+ refcount_t cra_refcnt;
char cra_name[CRYPTO_MAX_ALG_NAME];
char cra_driver_name[CRYPTO_MAX_ALG_NAME];