]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ice: Fix potential NULL pointer dereference in ice_bridge_setlink()
authorRand Deeb <rand.sec96@gmail.com>
Wed, 28 Feb 2024 15:54:48 +0000 (18:54 +0300)
committerSasha Levin <sashal@kernel.org>
Fri, 15 Mar 2024 14:48:17 +0000 (10:48 -0400)
commit1a770927dc1d642b22417c3e668c871689fc58b3
treee885523d671674860e735dbf00244f07e7849c6d
parent671a28603c6b3baf7e06469935c82270022654fa
net: ice: Fix potential NULL pointer dereference in ice_bridge_setlink()

[ Upstream commit 06e456a05d669ca30b224b8ed962421770c1496c ]

The function ice_bridge_setlink() may encounter a NULL pointer dereference
if nlmsg_find_attr() returns NULL and br_spec is dereferenced subsequently
in nla_for_each_nested(). To address this issue, add a check to ensure that
br_spec is not NULL before proceeding with the nested attribute iteration.

Fixes: b1edc14a3fbf ("ice: Implement ice_bridge_getlink and ice_bridge_setlink")
Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_main.c