[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191108113752.12502-28-sashal@kernel.org>
Date: Fri, 8 Nov 2019 06:34:55 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Dedy Lansky <dlansky@...eaurora.org>,
Maya Erez <merez@...eaurora.org>,
Kalle Valo <kvalo@...eaurora.org>,
Sasha Levin <sashal@...nel.org>,
linux-wireless@...r.kernel.org, wil6210@....qualcomm.com,
netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.19 028/205] wil6210: fix invalid memory access for rx_buff_mgmt debugfs
From: Dedy Lansky <dlansky@...eaurora.org>
[ Upstream commit 4405b632e3da839defec966e4b0be44d0c5e3102 ]
Check rx_buff_mgmt is allocated before accessing its internal fields.
Signed-off-by: Dedy Lansky <dlansky@...eaurora.org>
Signed-off-by: Maya Erez <merez@...eaurora.org>
Signed-off-by: Kalle Valo <kvalo@...eaurora.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/wireless/ath/wil6210/debugfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 51c3330bc316f..ceace95b1595c 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1263,6 +1263,9 @@ static int wil_rx_buff_mgmt_debugfs_show(struct seq_file *s, void *data)
int num_active;
int num_free;
+ if (!rbm->buff_arr)
+ return -EINVAL;
+
seq_printf(s, " size = %zu\n", rbm->size);
seq_printf(s, " free_list_empty_cnt = %lu\n",
rbm->free_list_empty_cnt);
--
2.20.1
Powered by blists - more mailing lists