]> git.baikalelectronics.ru Git - kernel.git/commit
net: add debug checks in napi_consume_skb and __napi_alloc_skb()
authorEric Dumazet <edumazet@google.com>
Wed, 8 Jun 2022 16:04:37 +0000 (09:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 04:53:56 +0000 (21:53 -0700)
commitfdba33e9a62d955d54624c990b24fada39c12eda
treeee1ded184dbb821ea3159db968a2eea9803a01d1
parentf9c267a1228f31e35a51117dcf0d6d9f5ec27502
net: add debug checks in napi_consume_skb and __napi_alloc_skb()

Commit b6d8e0945dbf ("net: Use lockdep_assert_in_softirq()
in napi_consume_skb()") added a check in napi_consume_skb()
which is a bit weak.

napi_consume_skb() and __napi_alloc_skb() should only
be used from BH context, not from hard irq or nmi context,
otherwise we could have races.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c