summaryrefslogtreecommitdiffstats
path: root/net/tls/tls_device_fallback.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-07-08 19:53:18 -0700
committerDavid S. Miller <davem@davemloft.net>2019-07-08 20:21:10 -0700
commit5c4b4608fe100838c62591877101128467e56c00 (patch)
tree8690bd0fe8a0e62fc8610face1254683ee6c31a1 /net/tls/tls_device_fallback.c
parent5a4cea280c01ba0ef3deda85c14fd1321eff3270 (diff)
downloadlinux-stable-5c4b4608fe100838c62591877101128467e56c00.tar.gz
linux-stable-5c4b4608fe100838c62591877101128467e56c00.tar.bz2
linux-stable-5c4b4608fe100838c62591877101128467e56c00.zip
net/tls: fix socket wmem accounting on fallback with netem
netem runs skb_orphan_partial() which "disconnects" the skb from normal TCP write memory accounting. We should not adjust sk->sk_wmem_alloc on the fallback path for such skbs. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_device_fallback.c')
-rw-r--r--net/tls/tls_device_fallback.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 1d2d804ac633..9070d68a92a4 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -209,6 +209,10 @@ static void complete_skb(struct sk_buff *nskb, struct sk_buff *skb, int headln)
update_chksum(nskb, headln);
+ /* sock_efree means skb must gone through skb_orphan_partial() */
+ if (nskb->destructor == sock_efree)
+ return;
+
delta = nskb->truesize - skb->truesize;
if (likely(delta < 0))
WARN_ON_ONCE(refcount_sub_and_test(-delta, &sk->sk_wmem_alloc));