Patch "net/mlx5e: Fix incorrect access of RCU-protected xdp_prog" has been added to the 5.9-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/mlx5e: Fix incorrect access of RCU-protected xdp_prog

to the 5.9-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-mlx5e-fix-incorrect-access-of-rcu-protected-xdp_.patch
and it can be found in the queue-5.9 subdirectory.

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



commit ce1c45688e165f7e96a952088325dacd3e763507
Author: Maxim Mikityanskiy <maximmi@xxxxxxxxxxxx>
Date:   Thu Oct 22 12:49:51 2020 +0300

    net/mlx5e: Fix incorrect access of RCU-protected xdp_prog
    
    [ Upstream commit 1a50cf9a67ff2241c2949d30bc11c8dd4280eef8 ]
    
    rq->xdp_prog is RCU-protected and should be accessed only with
    rcu_access_pointer for the NULL check in mlx5e_poll_rx_cq.
    
    rq->xdp_prog may change on the fly only from one non-NULL value to
    another non-NULL value, so the checks in mlx5e_xdp_handle and
    mlx5e_poll_rx_cq will have the same result during one NAPI cycle,
    meaning that no additional synchronization is needed.
    
    Fixes: fe45386a2082 ("net/mlx5e: Use RCU to protect rq->xdp_prog")
    Signed-off-by: Maxim Mikityanskiy <maximmi@xxxxxxxxxxxx>
    Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx>
    Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 64c8ac5eabf6a..a0a4398408b85 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -1566,7 +1566,7 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
 	} while ((++work_done < budget) && (cqe = mlx5_cqwq_get_cqe(cqwq)));
 
 out:
-	if (rq->xdp_prog)
+	if (rcu_access_pointer(rq->xdp_prog))
 		mlx5e_xdp_rx_poll_complete(rq);
 
 	mlx5_cqwq_update_db_record(cqwq);



[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