]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
be2net: Fix NULL pointer dereference in be_cmd_get_mac_from_list
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Tue, 20 Jan 2026 11:37:47 +0000 (11:37 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Jan 2026 03:18:57 +0000 (19:18 -0800)
commit8215794403d264739cc676668087512950b2ff31
tree122ed85c48d2203db3632ba251ac2479de6d2e28
parent2030c4358bd8451583f2e010108607de5cdac5dc
be2net: Fix NULL pointer dereference in be_cmd_get_mac_from_list

When the parameter pmac_id_valid argument of be_cmd_get_mac_from_list() is
set to false, the driver may request the PMAC_ID from the firmware of the
network card, and this function will store that PMAC_ID at the provided
address pmac_id. This is the contract of this function.

However, there is a location within the driver where both
pmac_id_valid == false and pmac_id == NULL are being passed. This could
result in dereferencing a NULL pointer.

To resolve this issue, it is necessary to pass the address of a stub
variable to the function.

Fixes: 95046b927a54 ("be2net: refactor MAC-addr setup code")
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Link: https://patch.msgid.link/20260120113734.20193-1-a.vatoropin@crpt.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/emulex/benet/be_cmds.c