mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
809778e02c
commit
ce8614a312
6 changed files with 11 additions and 11 deletions
|
|
@ -137,7 +137,7 @@ static struct crypto_alg *crypto_larval_add(const char *name, u32 type,
|
|||
if (IS_ERR(larval))
|
||||
return ERR_CAST(larval);
|
||||
|
||||
atomic_set(&larval->alg.cra_refcnt, 2);
|
||||
refcount_set(&larval->alg.cra_refcnt, 2);
|
||||
|
||||
down_write(&crypto_alg_sem);
|
||||
alg = __crypto_alg_lookup(name, type, mask);
|
||||
|
|
|
|||
Loading…
Reference in a new issue