]> git.baikalelectronics.ru Git - kernel.git/commit
net: add and use skb_unclone_keeptruesize() helper
authorEric Dumazet <edumazet@google.com>
Tue, 2 Nov 2021 00:45:55 +0000 (17:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:49:08 +0000 (09:49 +0100)
commitec0ba07fc34d6fed2dd3a141cc22f74e15adfff1
treec3999a48f51724785ebc46e6e6b6646e12ba6235
parent2d051756bb461a2ceac94794cd2b6bf46a819070
net: add and use skb_unclone_keeptruesize() helper

commit 639805fad2749e903477d391ecf9376455c984dd upstream.

While commit 6d0be49b56d7 ("net: fix up truesize of cloned
skb in skb_prepare_for_shift()") fixed immediate issues found
when KFENCE was enabled/tested, there are still similar issues,
when tcp_trim_head() hits KFENCE while the master skb
is cloned.

This happens under heavy networking TX workloads,
when the TX completion might be delayed after incoming ACK.

This patch fixes the WARNING in sk_stream_kill_queues
when sk->sk_mem_queued/sk->sk_forward_alloc are not zero.

Fixes: 97b051559488 ("mm, kfence: insert KFENCE hooks for SLAB")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Marco Elver <elver@google.com>
Link: https://lore.kernel.org/r/20211102004555.1359210-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/skbuff.h
net/core/skbuff.c
net/ipv4/tcp_output.c