Patch "xfrm: fix netdev reference count imbalance" has been added to the 6.10-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

    xfrm: fix netdev reference count imbalance

to the 6.10-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:
     xfrm-fix-netdev-reference-count-imbalance.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 5ca92f6d7f6d7d1c0b81cad84aaff3cb2ab2fd24
Author: Jianbo Liu <jianbol@xxxxxxxxxx>
Date:   Mon Jul 8 09:58:11 2024 +0300

    xfrm: fix netdev reference count imbalance
    
    [ Upstream commit 9199b915e9fad7f5eff6160d24ff6b38e970107d ]
    
    In cited commit, netdev_tracker_alloc() is called for the newly
    allocated xfrm state, but dev_hold() is missed, which causes netdev
    reference count imbalance, because netdev_put() is called when the
    state is freed in xfrm_dev_state_free(). Fix the issue by replacing
    netdev_tracker_alloc() with netdev_hold().
    
    Fixes: f8a70afafc17 ("xfrm: add TX datapath support for IPsec packet offload mode")
    Signed-off-by: Jianbo Liu <jianbol@xxxxxxxxxx>
    Reviewed-by: Cosmin Ratiu <cratiu@xxxxxxxxxx>
    Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 936f9348e5f63..67b2a399a48a7 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1331,8 +1331,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
 			xso->dev = xdo->dev;
 			xso->real_dev = xdo->real_dev;
 			xso->flags = XFRM_DEV_OFFLOAD_FLAG_ACQ;
-			netdev_tracker_alloc(xso->dev, &xso->dev_tracker,
-					     GFP_ATOMIC);
+			netdev_hold(xso->dev, &xso->dev_tracker, GFP_ATOMIC);
 			error = xso->dev->xfrmdev_ops->xdo_dev_state_add(x, NULL);
 			if (error) {
 				xso->dir = 0;




[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