[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250830081123.31033-1-linmq006@gmail.com>
Date: Sat, 30 Aug 2025 16:11:22 +0800
From: Miaoqian Lin <linmq006@...il.com>
To: Ido Schimmel <idosch@...dia.com>,
Petr Machata <petrm@...dia.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Vadim Pasternak <vadimp@...dia.com>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] mlxsw: core_env: Fix stack info leak in mlxsw_env_linecard_modules_power_mode_apply
The extack was declared on the stack without initialization.
If mlxsw_env_set_module_power_mode_apply() fails to set extack,
accessing extack._msg could leak information.
Fixes: 06a0fc43bb10 ("mlxsw: core_env: Add interfaces for line card initialization and de-initialization")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
index 294e758f1067..38941c1c35d3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
@@ -1332,7 +1332,7 @@ mlxsw_env_linecard_modules_power_mode_apply(struct mlxsw_core *mlxsw_core,
for (i = 0; i < env->line_cards[slot_index]->module_count; i++) {
enum ethtool_module_power_mode_policy policy;
struct mlxsw_env_module_info *module_info;
- struct netlink_ext_ack extack;
+ struct netlink_ext_ack extack = {};
int err;
module_info = &env->line_cards[slot_index]->module_info[i];
--
2.39.5 (Apple Git-154)
Powered by blists - more mailing lists