summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-07-01 07:39:09 -0700
committerDavid S. Miller <davem@davemloft.net>2017-07-01 07:39:09 -0700
commit4a7d9c2227d87b7299f12e4f8d3b39d9523fd31d (patch)
tree216e881888fc5cb9b10a4c5766f18b22db01773a
parent0930c08c6bc50a3a62ee3c90fad305840affbaf2 (diff)
parentb22728090830eb0e4d2509798f2c8cf4a7d28b06 (diff)
downloadlinux-crypto-4a7d9c2227d87b7299f12e4f8d3b39d9523fd31d.tar.gz
linux-crypto-4a7d9c2227d87b7299f12e4f8d3b39d9523fd31d.zip
Merge branch 'net-refcount_t'
Elena Reshetova says: ==================== v3 net generic subsystem refcount conversions Changes in v3: Rebased on top of the net-next tree. Changes in v2: No changes in patches apart from rebases, but now by default refcount_t = atomic_t (*) and uses all atomic standard operations unless CONFIG_REFCOUNT_FULL is enabled. This is a compromise for the systems that are critical on performance (such as net) and cannot accept even slight delay on the refcounter operations. This series, for core network subsystem components, replaces atomic_t reference counters with the new refcount_t type and API (see include/linux/refcount.h). By doing this we prevent intentional or accidental underflows or overflows that can led to use-after-free vulnerabilities. These patches contain only generic net pieces. Other changes will be sent separately. The patches are fully independent and can be cherry-picked separately. The big patches, such as conversions for sock structure, need a very detailed look from maintainers: refcount managing is quite complex in them and while it seems that they would benefit from the change, extra checking is needed. The biggest corner issue is the fact that refcount_inc() does not increment from zero. If there are no objections to the patches, please merge them via respective trees. * The respective change is currently merged into -next as "locking/refcount: Create unchecked atomic_t implementation". ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--crypto/algif_aead.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 8af664f7..be117495 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -877,7 +877,7 @@ static void aead_sock_destruct(struct sock *sk)
unsigned int ivlen = crypto_aead_ivsize(
crypto_aead_reqtfm(&ctx->aead_req));
- WARN_ON(atomic_read(&sk->sk_refcnt) != 0);
+ WARN_ON(refcount_read(&sk->sk_refcnt) != 0);
aead_put_sgl(sk);
sock_kzfree_s(sk, ctx->iv, ivlen);
sock_kfree_s(sk, ctx, ctx->len);