summaryrefslogtreecommitdiff
path: root/crypto/proc.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-12-29 10:00:46 -0600
committerHerbert Xu <herbert@gondor.apana.org.au>2018-01-05 18:43:09 +1100
commit2431f0da543e8c93333ed3b3c8ab9a1158404959 (patch)
tree61ec83a2a3b013ba8078d74be682dffa584a8109 /crypto/proc.c
parentaa6bade9aa65fa4e09010f6c744f4727fce612de (diff)
downloadlinux-crypto-2431f0da543e8c93333ed3b3c8ab9a1158404959.tar.gz
linux-crypto-2431f0da543e8c93333ed3b3c8ab9a1158404959.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 'crypto/proc.c')
-rw-r--r--crypto/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/proc.c b/crypto/proc.c
index 2cc10c96..822fcef6 100644
--- a/crypto/proc.c
+++ b/crypto/proc.c
@@ -46,7 +46,7 @@ static int c_show(struct seq_file *m, void *p)
seq_printf(m, "driver : %s\n", alg->cra_driver_name);
seq_printf(m, "module : %s\n", module_name(alg->cra_module));
seq_printf(m, "priority : %d\n", alg->cra_priority);
- seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt));
+ seq_printf(m, "refcnt : %u\n", refcount_read(&alg->cra_refcnt));
seq_printf(m, "selftest : %s\n",
(alg->cra_flags & CRYPTO_ALG_TESTED) ?
"passed" : "unknown");