2023-01-03 14:12:15

by Ping-Ke Shih

[permalink] [raw]
Subject: [PATCH] wifi: rtw89: fix potential leak in rtw89_append_probe_req_ie()

From: Zong-Zhe Yang <[email protected]>

Do `kfree_skb(new)` before `goto out` to prevent potential leak.

Fixes: 895907779752 ("rtw89: 8852a: add ieee80211_ops::hw_scan")
Signed-off-by: Zong-Zhe Yang <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
---
drivers/net/wireless/realtek/rtw89/fw.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 0328874a0d10e..466d8273bc2b1 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -2676,8 +2676,10 @@ static int rtw89_append_probe_req_ie(struct rtw89_dev *rtwdev,

list_add_tail(&info->list, &scan_info->pkt_list[band]);
ret = rtw89_fw_h2c_add_pkt_offload(rtwdev, &info->id, new);
- if (ret)
+ if (ret) {
+ kfree_skb(new);
goto out;
+ }

kfree_skb(new);
}
--
2.25.1


2023-01-16 13:39:53

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: rtw89: fix potential leak in rtw89_append_probe_req_ie()

Ping-Ke Shih <[email protected]> wrote:

> From: Zong-Zhe Yang <[email protected]>
>
> Do `kfree_skb(new)` before `goto out` to prevent potential leak.
>
> Fixes: 895907779752 ("rtw89: 8852a: add ieee80211_ops::hw_scan")
> Signed-off-by: Zong-Zhe Yang <[email protected]>
> Signed-off-by: Ping-Ke Shih <[email protected]>

Patch applied to wireless-next.git, thanks.

4a0e218cc9c4 wifi: rtw89: fix potential leak in rtw89_append_probe_req_ie()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches