[Devel] [PATCH RHEL9 COMMIT] ms/net: neigh: use dev_kfree_skb_irq instead of kfree_skb()

Konstantin Khorenko khorenko at virtuozzo.com
Thu Aug 18 19:10:54 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-70.13.1.vz9.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-70.13.1.vz9.16.10
------>
commit 3fd70816171be2df2e62053e0b87f9273c7b0b84
Author: Yang Yingliang <yangyingliang at huawei.com>
Date:   Thu Aug 18 18:44:58 2022 +0300

    ms/net: neigh: use dev_kfree_skb_irq instead of kfree_skb()
    
    It is not allowed to call kfree_skb() from hardware interrupt
    context or with interrupts being disabled. So replace kfree_skb()
    with dev_kfree_skb_irq() under spin_lock_irqsave().
    
    mFixes: 66ba215cb513 ("neigh: fix possible DoS due to net iface
    start/stop loop")
    Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
    
    https://jira.sw.ru/browse/PSBM-141661
    
    The patch is not accepted by the mainstream, moreover probably there
    will be another version of the patch accepted, but for now let's just
    take the current version of the patch and substitute it later with the
    final one.
    
    https://lore.kernel.org/netdev/79784952-0d15-8a4a-aa8d-590bc243ab5e@virtuozzo.com/t/
---
 net/core/neighbour.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 4f7edf22c2fd..00a34da3b751 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -304,7 +304,7 @@ static void pneigh_queue_purge(struct sk_buff_head *list, struct net *net)
 			__skb_unlink(skb, list);
 
 			dev_put(dev);
-			kfree_skb(skb);
+			dev_kfree_skb_irq(skb);
 		}
 		skb = skb_next;
 	}


More information about the Devel mailing list