Loading
net: ice: Fix potential NULL pointer dereference in ice_bridge_setlink()
stable inclusion from stable-v5.10.213 commit 37fe99016b12d32100ce670216816dba6c48b309 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HK2H CVE: CVE-2024-26855 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=37fe99016b12d32100ce670216816dba6c48b309 -------------------------------- [ 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: b1edc14a ("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> Signed-off-by:
Zhenzeng Su <suzhenzeng@huawei.com>