Commit aa1a4e2f authored by Duoming Zhou's avatar Duoming Zhou Committed by Liu Chuang
Browse files

nfp: flower: handle acti_netdevs allocation failure

stable inclusion
from stable-v4.19.311
commit d746889db75a76aeee95fb705b8e1ac28c684a2e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9NDFD
CVE: CVE-2024-27046

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d746889db75a76aeee95fb705b8e1ac28c684a2e



--------------------------------

[ Upstream commit 84e95149bd341705f0eca6a7fcb955c548805002 ]

The kmalloc_array() in nfp_fl_lag_do_work() will return null, if
the physical memory has run out. As a result, if we dereference
the acti_netdevs, the null pointer dereference bugs will happen.

This patch adds a check to judge whether allocation failure occurs.
If it happens, the delayed work will be rescheduled and try again.

Fixes: bb9a8d03 ("nfp: flower: monitor and offload LAG groups")
Signed-off-by: default avatarDuoming Zhou <duoming@zju.edu.cn>
Reviewed-by: default avatarLouis Peens <louis.peens@corigine.com>
Link: https://lore.kernel.org/r/20240308142540.9674-1-duoming@zju.edu.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLiu Chuang <liuchuang40@huawei.com>
parent b9f13a64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment