]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
idpf: improve locking around idpf_vc_xn_push_free()
authorEmil Tantilov <emil.s.tantilov@intel.com>
Thu, 19 Mar 2026 21:13:34 +0000 (14:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2026 08:46:46 +0000 (10:46 +0200)
commit d086fae65006368618104ba4c57779440eab2217 upstream.

Protect the set_bit() operation for the free_xn bitmask in
idpf_vc_xn_push_free(), to make the locking consistent with rest of the
code and avoid potential races in that logic.

Fixes: 34c21fa894a1 ("idpf: implement virtchnl transaction manager")
Cc: stable@vger.kernel.org
Reported-by: Ray Zhang <sgzhang@google.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

index aebc1f6fb77e49ec549ee3b258b52e0a95694021..0af93bc3e6bd7b5186d969eb6342f2c0e5c7f2f8 100644 (file)
@@ -399,7 +399,9 @@ static void idpf_vc_xn_push_free(struct idpf_vc_xn_manager *vcxn_mngr,
                                 struct idpf_vc_xn *xn)
 {
        idpf_vc_xn_release_bufs(xn);
+       spin_lock_bh(&vcxn_mngr->xn_bm_lock);
        set_bit(xn->idx, vcxn_mngr->free_xn_bm);
+       spin_unlock_bh(&vcxn_mngr->xn_bm_lock);
 }
 
 /**