Patch "net: fix __dev_kfree_skb_any() vs drop monitor" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: fix __dev_kfree_skb_any() vs drop monitor

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-fix-__dev_kfree_skb_any-vs-drop-monitor.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 43bb144c648fc7af4721a1ef41954f5fc58232d0
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Thu Feb 23 08:38:45 2023 +0000

    net: fix __dev_kfree_skb_any() vs drop monitor
    
    [ Upstream commit ac3ad19584b26fae9ac86e4faebe790becc74491 ]
    
    dev_kfree_skb() is aliased to consume_skb().
    
    When a driver is dropping a packet by calling dev_kfree_skb_any()
    we should propagate the drop reason instead of pretending
    the packet was consumed.
    
    Note: Now we have enum skb_drop_reason we could remove
    enum skb_free_reason (for linux-6.4)
    
    v2: added an unlikely(), suggested by Yunsheng Lin.
    
    Fixes: e6247027e517 ("net: introduce dev_consume_skb_any()")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: Yunsheng Lin <linyunsheng@xxxxxxxxxx>
    Reviewed-by: Yunsheng Lin <linyunsheng@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/core/dev.c b/net/core/dev.c
index f23e287602b7e..fce980d531bdc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3131,8 +3131,10 @@ void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason)
 {
 	if (in_hardirq() || irqs_disabled())
 		__dev_kfree_skb_irq(skb, reason);
+	else if (unlikely(reason == SKB_REASON_DROPPED))
+		kfree_skb(skb);
 	else
-		dev_kfree_skb(skb);
+		consume_skb(skb);
 }
 EXPORT_SYMBOL(__dev_kfree_skb_any);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux