]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix incorrect access of RCU-protected xdp_prog
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Thu, 22 Oct 2020 09:49:51 +0000 (12:49 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 5 Nov 2020 20:17:06 +0000 (12:17 -0800)
commitfdecbcd1f3c23e6402b1d841521f845f311968e2
treec1426f91a7957e7db696038293a96e03b258a2ac
parent84f245812e9a5932f4fdb46d97e78662abf618b0
net/mlx5e: Fix incorrect access of RCU-protected xdp_prog

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: 46bd3e662d36 ("net/mlx5e: Use RCU to protect rq->xdp_prog")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c