net: neigh: don't call kfree_skb() under spin_lock_irqsave()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 22 Aug 2022 02:53:46 +0000 (10:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Sep 2022 08:30:13 +0000 (10:30 +0200)
commit572b646c8d9388b31aa5fe8c97276d8f5686d77a
tree13260964daa9650073b7b646bd5a02b575caef23
parentfacf99bc3a951ab7adddfc7a88b1411d01342d82
net: neigh: don't call kfree_skb() under spin_lock_irqsave()

commit d5485d9dd24e1d04e5509916515260186eb1455c upstream.

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. So add all skb to
a tmp list, then free them after spin_unlock_irqrestore() at
once.

Fixes: 66ba215cb513 ("neigh: fix possible DoS due to net iface start/stop loop")
Suggested-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/neighbour.c