* [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices
@ 2021-04-15 10:47 Abinaya Kalaiselvan
2021-04-19 11:23 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Abinaya Kalaiselvan @ 2021-04-15 10:47 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Abinaya Kalaiselvan
"sband->iftype_data" is not assigned with any value for non HE supported
devices, which causes NULL pointer access during mesh peer connection
in those devices. Fix this by accessing the pointer after HE
capabilities condition check.
Fixes: 7f7aa94bcaf0 (mac80211: reduce peer HE MCS/NSS to own capabilities)
Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
---
v2:
* ieee80211_sta_he_cap structure instance is initialized.
net/mac80211/he.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index 0c0b970..96a47b0 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -111,7 +111,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta)
{
struct ieee80211_sta_he_cap *he_cap = &sta->sta.he_cap;
- struct ieee80211_sta_he_cap own_he_cap = sband->iftype_data->he_cap;
+ struct ieee80211_sta_he_cap own_he_cap = {0};
struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
u8 he_ppe_size;
u8 mcs_nss_size;
@@ -123,6 +123,8 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
if (!he_cap_ie || !ieee80211_get_he_sta_cap(sband))
return;
+ own_he_cap = sband->iftype_data->he_cap;
+
/* Make sure size is OK */
mcs_nss_size = ieee80211_he_mcs_nss_size(he_cap_ie_elem);
he_ppe_size =
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices
2021-04-15 10:47 [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices Abinaya Kalaiselvan
@ 2021-04-19 11:23 ` Johannes Berg
2021-06-15 14:17 ` Nicolas Cavallari
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2021-04-19 11:23 UTC (permalink / raw)
To: Abinaya Kalaiselvan; +Cc: linux-wireless
On Thu, 2021-04-15 at 16:17 +0530, Abinaya Kalaiselvan wrote:
> "sband->iftype_data" is not assigned with any value for non HE supported
> devices, which causes NULL pointer access during mesh peer connection
> in those devices. Fix this by accessing the pointer after HE
> capabilities condition check.
>
> Fixes: 7f7aa94bcaf0 (mac80211: reduce peer HE MCS/NSS to own capabilities)
> Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
> ---
> v2:
> * ieee80211_sta_he_cap structure instance is initialized.
>
How about taking other feedback into account?
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices
2021-04-19 11:23 ` Johannes Berg
@ 2021-06-15 14:17 ` Nicolas Cavallari
2021-06-23 14:42 ` Abinaya Kalaiselvan
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Cavallari @ 2021-06-15 14:17 UTC (permalink / raw)
To: Johannes Berg, Abinaya Kalaiselvan; +Cc: linux-wireless
On 19/04/2021 13:23, Johannes Berg wrote:
> On Thu, 2021-04-15 at 16:17 +0530, Abinaya Kalaiselvan wrote:
>> "sband->iftype_data" is not assigned with any value for non HE supported
>> devices, which causes NULL pointer access during mesh peer connection
>> in those devices. Fix this by accessing the pointer after HE
>> capabilities condition check.
>>
>> Fixes: 7f7aa94bcaf0 (mac80211: reduce peer HE MCS/NSS to own capabilities)
>> Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
>> ---
>> v2:
>> * ieee80211_sta_he_cap structure instance is initialized.
>>
> How about taking other feedback into account?
>
> johannes
>
I got a crash because of this bug and this patch fixes it. Abinaya, do you plan
to submit a version with the indentation fixed, or can I do it ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices
2021-06-15 14:17 ` Nicolas Cavallari
@ 2021-06-23 14:42 ` Abinaya Kalaiselvan
0 siblings, 0 replies; 4+ messages in thread
From: Abinaya Kalaiselvan @ 2021-06-23 14:42 UTC (permalink / raw)
To: Nicolas Cavallari; +Cc: Johannes Berg, linux-wireless
On 2021-06-15 19:47, Nicolas Cavallari wrote:
> On 19/04/2021 13:23, Johannes Berg wrote:
>> On Thu, 2021-04-15 at 16:17 +0530, Abinaya Kalaiselvan wrote:
>>> "sband->iftype_data" is not assigned with any value for non HE
>>> supported
>>> devices, which causes NULL pointer access during mesh peer connection
>>> in those devices. Fix this by accessing the pointer after HE
>>> capabilities condition check.
>>>
>>> Fixes: 7f7aa94bcaf0 (mac80211: reduce peer HE MCS/NSS to own
>>> capabilities)
>>> Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
>>> ---
>>> v2:
>>> * ieee80211_sta_he_cap structure instance is initialized.
>>>
>> How about taking other feedback into account?
>>
>> johannes
>>
>
> I got a crash because of this bug and this patch fixes it. Abinaya, do
> you plan to submit a version with the indentation fixed, or can I do
> it ?
Thanks Nicolas. I have sent the updated patch with indentation fix.
Thanks,
Abinaya Kalaiselvan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-23 14:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-15 10:47 [PATCHv2] mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices Abinaya Kalaiselvan
2021-04-19 11:23 ` Johannes Berg
2021-06-15 14:17 ` Nicolas Cavallari
2021-06-23 14:42 ` Abinaya Kalaiselvan
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).