* Re: patch 46/47 causes NULL pointer deref on mt7921
[not found] ` <e32ab97963e850b4425e4f5c45d2c502d50be480.camel@web.de>
@ 2024-08-12 8:57 ` Bert Karwatzki
2024-08-12 10:29 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Bert Karwatzki @ 2024-08-12 8:57 UTC (permalink / raw)
To: Kalle Valo
Cc: Felix Fietkau, Sean Wang, deren.wu, linux-mediatek,
linux-wireless, lorenzo.bianconi, mingyen.hsieh, sean.wang,
spasswolf, linux-kernel, deren.wu
Am Dienstag, dem 06.08.2024 um 13:22 +0200 schrieb Bert Karwatzki:
> Am Mittwoch, dem 31.07.2024 um 11:51 +0300 schrieb Kalle Valo:
> > Bert Karwatzki <spasswolf@web.de> writes:
> >
> > > Am Mittwoch, dem 17.07.2024 um 17:25 +0200 schrieb Felix Fietkau:
> > >
> > > > On 17.07.24 16:38, Bert Karwatzki wrote:
> > > >
> > > > > So mvif->phy can be NULL at the start of mt7921_ipv6_addr_change. The early
> > > > > return in that case avoids the NULL pointer and mvif->phy has its usual value
> > > > > again on the next call to mt7921_ipv6_addr_change so Wifi is working again. I
> > > > > don't know how this could happen but perhaps you have an idea.
> > > >
> > > > This change should fix it: https://nbd.name/p/0747f54f
> > > > Please test.
> > >
> > > The BUG is still present in linux-6.11-rc1.
> >
> > I'm not sure what's the status with this. There's one mt76 patch going
> > to v6.11-rc2:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commit/?id=6557a28f3e3a54cff4f0dcdd1dfa649b26557ab3
> >
> > But that looks to be a fix for a different problem, right? Felix, are
> > you planning to submit that 0747f54f as a proper patch? I could then
> > take it to wireless tree.
> >
> The Bug is still present in linux-6.11-rc2 and linux-next-20240806. Also the
> mvif->phy NULL check in the original patch is not neccessary (and feels a little
> out of place as mvif->phy is not needed anymore). This patch is sufficient to
> fix the NULL pointer dereference:
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> index 1bab93d049df..23b228804289 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
> @@ -1183,7 +1183,7 @@ static void mt7921_ipv6_addr_change(struct ieee80211_hw
> *hw,
> struct inet6_dev *idev)
> {
> struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
> - struct mt792x_dev *dev = mvif->phy->dev;
> + struct mt792x_dev *dev = mt792x_hw_dev(hw);
> struct inet6_ifaddr *ifa;
> struct in6_addr ns_addrs[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
> struct sk_buff *skb;
>
> Bert Karwatzki
This error is still present in v6.11-rc3.
Bert Karwatzki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: patch 46/47 causes NULL pointer deref on mt7921
2024-08-12 8:57 ` patch 46/47 causes NULL pointer deref on mt7921 Bert Karwatzki
@ 2024-08-12 10:29 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2024-08-12 10:29 UTC (permalink / raw)
To: Bert Karwatzki
Cc: Felix Fietkau, Sean Wang, deren.wu, linux-mediatek,
linux-wireless, lorenzo.bianconi, mingyen.hsieh, sean.wang,
linux-kernel
Bert Karwatzki <spasswolf@web.de> writes:
> Am Dienstag, dem 06.08.2024 um 13:22 +0200 schrieb Bert Karwatzki:
>> Am Mittwoch, dem 31.07.2024 um 11:51 +0300 schrieb Kalle Valo:
>> > Bert Karwatzki <spasswolf@web.de> writes:
>> >
>> > > Am Mittwoch, dem 17.07.2024 um 17:25 +0200 schrieb Felix Fietkau:
>> > >
>> > > > On 17.07.24 16:38, Bert Karwatzki wrote:
>> > > >
>> > > > > So mvif->phy can be NULL at the start of mt7921_ipv6_addr_change. The early
>> > > > > return in that case avoids the NULL pointer and mvif->phy
>> > > > > has its usual value
>> > > > > again on the next call to mt7921_ipv6_addr_change so Wifi is
>> > > > > working again. I
>> > > > > don't know how this could happen but perhaps you have an idea.
>> > > >
>> > > > This change should fix it: https://nbd.name/p/0747f54f
>> > > > Please test.
>> > >
>> > > The BUG is still present in linux-6.11-rc1.
>> >
>> > I'm not sure what's the status with this. There's one mt76 patch going
>> > to v6.11-rc2:
>> >
>> > https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commit/?id=6557a28f3e3a54cff4f0dcdd1dfa649b26557ab3
>> >
>> > But that looks to be a fix for a different problem, right? Felix, are
>> > you planning to submit that 0747f54f as a proper patch? I could then
>> > take it to wireless tree.
>> >
>> The Bug is still present in linux-6.11-rc2 and linux-next-20240806. Also the
>> mvif->phy NULL check in the original patch is not neccessary (and feels a little
>> out of place as mvif->phy is not needed anymore). This patch is sufficient to
>> fix the NULL pointer dereference:
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
>> b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
>> index 1bab93d049df..23b228804289 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
>> @@ -1183,7 +1183,7 @@ static void mt7921_ipv6_addr_change(struct ieee80211_hw
>> *hw,
>> struct inet6_dev *idev)
>> {
>> struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
>> - struct mt792x_dev *dev = mvif->phy->dev;
>> + struct mt792x_dev *dev = mt792x_hw_dev(hw);
>> struct inet6_ifaddr *ifa;
>> struct in6_addr ns_addrs[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
>> struct sk_buff *skb;
>>
>> Bert Karwatzki
>
> This error is still present in v6.11-rc3.
Bert, can you send your fix as a proper patch? More information in the
wiki below and please mark it for wireless tree.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-12 10:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240711175156.4465-1-spasswolf@web.de>
[not found] ` <CAGp9LzoXMoAW6dVZjTf-JcD_wiU4yXpGwkLaVyWXTkaV2MOKwg@mail.gmail.com>
[not found] ` <adb192a59c44aa8708e80df30a6a47816a03e50f.camel@web.de>
[not found] ` <4e943a62736f955af5d9cd1aff7e2b9c084c8885.camel@web.de>
[not found] ` <2599b886-9c63-4989-a08a-7feab28f7c49@nbd.name>
[not found] ` <65621cad9a22df881745e9333a5c3696bdbb8df3.camel@web.de>
[not found] ` <87frrqkkpm.fsf@kernel.org>
[not found] ` <e32ab97963e850b4425e4f5c45d2c502d50be480.camel@web.de>
2024-08-12 8:57 ` patch 46/47 causes NULL pointer deref on mt7921 Bert Karwatzki
2024-08-12 10:29 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox