]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix macsec possible null dereference when updating MAC security entity...
authorEmeel Hakim <ehakim@nvidia.com>
Sun, 11 Dec 2022 11:22:23 +0000 (13:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:30 +0000 (11:58 +0100)
commit7a1c708c151533973bfc886921d62c623b6f7e35
treee685cf52f19327abb62949b149246cc6de1ba4fb
parent84ded016f4df21f0d1760fe0e3bf14f92d167e54
net/mlx5e: Fix macsec possible null dereference when updating MAC security entity (SecY)

[ Upstream commit 9828994ac492e8e7de47fe66097b7e665328f348 ]

Upon updating MAC security entity (SecY) in hw offload path, the macsec
security association (SA) initialization routine is called. In case of
extended packet number (epn) is enabled the salt and ssci attributes are
retrieved using the MACsec driver rx_sa context which is unavailable when
updating a SecY property such as encoding-sa hence the null dereference.
Fix by using the provided SA to set those attributes.

Fixes: 25a2465945e7 ("net/mlx5e: Support MACsec offload extended packet number (EPN)")
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c