]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: really orphan skbs tied to closing sk
authorPaolo Abeni <pabeni@redhat.com>
Tue, 11 May 2021 08:35:21 +0000 (10:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:59:13 +0000 (08:59 +0200)
commit41f7f37ddefe47e157faeb1cd71e850883bba33c
treec1f74e87ec965fcb6e43875e43c793440728788f
parent694f68527e755385b8281548ce742065867b4ad9
net: really orphan skbs tied to closing sk

[ Upstream commit 098116e7e640ba677d9e345cbee83d253c13d556 ]

If the owing socket is shutting down - e.g. the sock reference
count already dropped to 0 and only sk_wmem_alloc is keeping
the sock alive, skb_orphan_partial() becomes a no-op.

When forwarding packets over veth with GRO enabled, the above
causes refcount errors.

This change addresses the issue with a plain skb_orphan() call
in the critical scenario.

Fixes: 9adc89af724f ("net: let skb_orphan_partial wake-up waiters.")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/sock.h
net/core/sock.c