linux/include
Antoine Tenart 9eeabdf17f net: fix a memleak when uncloning an skb dst and its metadata
When uncloning an skb dst and its associated metadata, a new
dst+metadata is allocated and later replaces the old one in the skb.
This is helpful to have a non-shared dst+metadata attached to a specific
skb.

The issue is the uncloned dst+metadata is initialized with a refcount of
1, which is increased to 2 before attaching it to the skb. When
tun_dst_unclone returns, the dst+metadata is only referenced from a
single place (the skb) while its refcount is 2. Its refcount will never
drop to 0 (when the skb is consumed), leading to a memory leak.

Fix this by removing the call to dst_hold in tun_dst_unclone, as the
dst+metadata refcount is already 1.

Fixes: fc4099f172 ("openvswitch: Fix egress tunnel info.")
Cc: Pravin B Shelar <pshelar@ovn.org>
Reported-by: Vlad Buslov <vladbu@nvidia.com>
Tested-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-09 11:41:47 +00:00
..
acpi
asm-generic bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
clocksource
crypto lib/crypto: blake2s: move hmac construction into wireguard 2022-01-18 13:03:55 +01:00
drm
dt-bindings
keys
kunit kunit: replace kernel.h with the necessary inclusions 2022-01-20 08:52:54 +02:00
kvm
linux Networking fixes for 5.17-rc3, including fixes from bpf, netfilter, 2022-02-03 16:54:18 -08:00
math-emu
media
memory
misc
net net: fix a memleak when uncloning an skb dst and its metadata 2022-02-09 11:41:47 +00:00
pcmcia
ras
rdma
scsi Merge branch 'akpm' (patches from Andrew) 2022-01-22 11:28:23 +02:00
soc
sound
target
trace Tracing fixes for 5.17-rc1: 2022-01-28 19:30:35 +02:00
uapi netfilter: ctnetlink: disable helper autoassign 2022-02-04 05:39:57 +01:00
vdso
video
xen