]> 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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Nov 2021 01:10:34 +0000 (18:10 -0700)
commite71c6832f4ca044e0f857278fb61053c6bdca289
tree88c4cb6d3fa42b985c17ef59447197a32c9a7128
parentae877a58abb4e201652f0246c393c62f4cdd0a5f
net: add and use skb_unclone_keeptruesize() helper

While commit 72936b487089 ("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: 03ab8f193f9c ("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>
include/linux/skbuff.h
net/core/skbuff.c
net/ipv4/tcp_output.c