diff options
author | Eric Dumazet <edumazet@google.com> | 2023-04-21 12:43:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-04-23 15:35:07 +0300 |
commit | e8e1ce8454c9cc8ad2e4422bef346428e52455e3 (patch) | |
tree | 0700baaf60ac712eea5378ce631ed6ab0fb310e3 /net/core | |
parent | 19c60fdee5db881a99a9c39fb31942a530d20c63 (diff) | |
download | linux-e8e1ce8454c9cc8ad2e4422bef346428e52455e3.tar.xz |
net: add debugging checks in skb_attempt_defer_free()
Make sure skbs that are stored in softnet_data.defer_list
do not have a dst attached.
Also make sure the the skb was orphaned.
Link: https://lore.kernel.org/netdev/CANn89iJuEVe72bPmEftyEJHLzzN=QNR2yueFjTxYXCEpS5S8HQ@mail.gmail.com/T/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 0d998806b377..bd815a00d2af 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -6881,6 +6881,9 @@ nodefer: __kfree_skb(skb); return; } + DEBUG_NET_WARN_ON_ONCE(skb_dst(skb)); + DEBUG_NET_WARN_ON_ONCE(skb->destructor); + sd = &per_cpu(softnet_data, cpu); defer_max = READ_ONCE(sysctl_skb_defer_max); if (READ_ONCE(sd->defer_count) >= defer_max) |