* [PATCH][next] wil6210: fix potential null dereference of ndev before null check
@ 2018-03-28 17:40 Colin King
2018-03-28 17:46 ` merez
2018-04-10 14:30 ` [next] " Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2018-03-28 17:40 UTC (permalink / raw)
To: Maya Erez, Kalle Valo, linux-wireless, wil6210, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The pointer ndev is being dereferenced before it is being null checked,
hence there is a potential null pointer deference. Fix this by only
dereferencing ndev after it has been null checked
Detected by CoverityScan, CID#1467010 ("Dereference before null check")
Fixes: e00243fab84b ("wil6210: infrastructure for multiple virtual interfaces")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/wireless/ath/wil6210/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index a4b413e8d55a..82aec6b06d09 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -391,7 +391,7 @@ static void wil_fw_error_worker(struct work_struct *work)
struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
fw_error_worker);
struct net_device *ndev = wil->main_ndev;
- struct wireless_dev *wdev = ndev->ieee80211_ptr;
+ struct wireless_dev *wdev;
wil_dbg_misc(wil, "fw error worker\n");
@@ -399,6 +399,7 @@ static void wil_fw_error_worker(struct work_struct *work)
wil_info(wil, "No recovery - interface is down\n");
return;
}
+ wdev = ndev->ieee80211_ptr;
/* increment @recovery_count if less then WIL6210_FW_RECOVERY_TO
* passed since last recovery attempt
--
2.15.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next] wil6210: fix potential null dereference of ndev before null check
2018-03-28 17:40 [PATCH][next] wil6210: fix potential null dereference of ndev before null check Colin King
@ 2018-03-28 17:46 ` merez
2018-03-29 4:53 ` Kalle Valo
2018-04-10 14:30 ` [next] " Kalle Valo
1 sibling, 1 reply; 4+ messages in thread
From: merez @ 2018-03-28 17:46 UTC (permalink / raw)
To: Colin King
Cc: Kalle Valo, linux-wireless, wil6210, netdev, kernel-janitors,
linux-kernel, linux-wireless-owner
On 2018-03-28 20:40, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer ndev is being dereferenced before it is being null checked,
> hence there is a potential null pointer deference. Fix this by only
> dereferencing ndev after it has been null checked
>
> Detected by CoverityScan, CID#1467010 ("Dereference before null check")
>
> Fixes: e00243fab84b ("wil6210: infrastructure for multiple virtual
> interfaces")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wireless/ath/wil6210/main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/wil6210/main.c
> b/drivers/net/wireless/ath/wil6210/main.c
> index a4b413e8d55a..82aec6b06d09 100644
> --- a/drivers/net/wireless/ath/wil6210/main.c
> +++ b/drivers/net/wireless/ath/wil6210/main.c
> @@ -391,7 +391,7 @@ static void wil_fw_error_worker(struct work_struct
> *work)
> struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
> fw_error_worker);
> struct net_device *ndev = wil->main_ndev;
> - struct wireless_dev *wdev = ndev->ieee80211_ptr;
> + struct wireless_dev *wdev;
>
> wil_dbg_misc(wil, "fw error worker\n");
>
> @@ -399,6 +399,7 @@ static void wil_fw_error_worker(struct work_struct
> *work)
> wil_info(wil, "No recovery - interface is down\n");
> return;
> }
> + wdev = ndev->ieee80211_ptr;
>
> /* increment @recovery_count if less then WIL6210_FW_RECOVERY_TO
> * passed since last recovery attempt
Reviewed-by: Maya Erez <merez@codeaurora.org>
--
Maya Erez
Qualcomm Israel, Inc. on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] wil6210: fix potential null dereference of ndev before null check
2018-03-28 17:46 ` merez
@ 2018-03-29 4:53 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-03-29 4:53 UTC (permalink / raw)
To: merez
Cc: Colin King, linux-wireless, wil6210, netdev, kernel-janitors,
linux-kernel
merez@codeaurora.org writes:
> On 2018-03-28 20:40, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The pointer ndev is being dereferenced before it is being null checked,
>> hence there is a potential null pointer deference. Fix this by only
>> dereferencing ndev after it has been null checked
>>
>> Detected by CoverityScan, CID#1467010 ("Dereference before null check")
>>
>> Fixes: e00243fab84b ("wil6210: infrastructure for multiple virtual
>> interfaces")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
[...]
> Reviewed-by: Maya Erez <merez@codeaurora.org>
Maya, as you are the wil6210 maintainer you can actually use Acked-by
instead of Reviewed-by. Not that it really matters which one you use,
both of them indicate me that you have checked and agree the patch, but
wanted to point out this anyway :)
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [next] wil6210: fix potential null dereference of ndev before null check
2018-03-28 17:40 [PATCH][next] wil6210: fix potential null dereference of ndev before null check Colin King
2018-03-28 17:46 ` merez
@ 2018-04-10 14:30 ` Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-04-10 14:30 UTC (permalink / raw)
To: Colin Ian King
Cc: Maya Erez, linux-wireless, wil6210, netdev, kernel-janitors,
linux-kernel
Colin Ian King <colin.king@canonical.com> wrote:
> The pointer ndev is being dereferenced before it is being null checked,
> hence there is a potential null pointer deference. Fix this by only
> dereferencing ndev after it has been null checked
>
> Detected by CoverityScan, CID#1467010 ("Dereference before null check")
>
> Fixes: e00243fab84b ("wil6210: infrastructure for multiple virtual interfaces")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Maya Erez <merez@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
db5a4d5e1073 wil6210: fix potential null dereference of ndev before null check
--
https://patchwork.kernel.org/patch/10313705/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-10 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 17:40 [PATCH][next] wil6210: fix potential null dereference of ndev before null check Colin King
2018-03-28 17:46 ` merez
2018-03-29 4:53 ` Kalle Valo
2018-04-10 14:30 ` [next] " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).