mbox series

[v3,0/3] rtw89: fix crash when loading firmware file on certain platforms

Message ID 20211119054512.10620-1-pkshih@realtek.com (mailing list archive)
Headers show
Series rtw89: fix crash when loading firmware file on certain platforms | expand

Message

Ping-Ke Shih Nov. 19, 2021, 5:45 a.m. UTC
First patch is to avoid writing "partition size" on read-only firmware
buffer, so it has to fix the crash.
The later two patches are used to make the semantics clear, but they don't
change the logic at all.

I hope at least first patch can be taken into 5.16-rc, so people can avoid
this crash.

v3: Modify patch 3/3 to convert more inline functions I missed.
v2: Add Buglink and Tested-by tags.

Ping-Ke Shih (3):
  rtw89: update partition size of firmware header on skb->data
  rtw89: add const in the cast of le32_get_bits()
  rtw89: use inline function instead macro to set H2C and CAM

 drivers/net/wireless/realtek/rtw89/cam.h  |  468 +++--
 drivers/net/wireless/realtek/rtw89/fw.c   |    2 +-
 drivers/net/wireless/realtek/rtw89/fw.h   | 2175 ++++++++++++---------
 drivers/net/wireless/realtek/rtw89/txrx.h |   46 +-
 4 files changed, 1656 insertions(+), 1035 deletions(-)

Comments

Kalle Valo Nov. 19, 2021, 12:05 p.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> writes:

> First patch is to avoid writing "partition size" on read-only firmware
> buffer, so it has to fix the crash.
> The later two patches are used to make the semantics clear, but they don't
> change the logic at all.
>
> I hope at least first patch can be taken into 5.16-rc, so people can avoid
> this crash.

My plan is to take patch 1 to wireless-drivers. And, after patch 1
trickles down to wireless-drivers-next, patch 2-3 to
wireless-drivers-next. Sounds good to everyone?
Takashi Iwai Nov. 19, 2021, 1:56 p.m. UTC | #2
On Fri, 19 Nov 2021 13:05:56 +0100,
Kalle Valo wrote:
> 
> Ping-Ke Shih <pkshih@realtek.com> writes:
> 
> > First patch is to avoid writing "partition size" on read-only firmware
> > buffer, so it has to fix the crash.
> > The later two patches are used to make the semantics clear, but they don't
> > change the logic at all.
> >
> > I hope at least first patch can be taken into 5.16-rc, so people can avoid
> > this crash.
> 
> My plan is to take patch 1 to wireless-drivers. And, after patch 1
> trickles down to wireless-drivers-next, patch 2-3 to
> wireless-drivers-next. Sounds good to everyone?

Yes, sounds like a good plan.


thanks,

Takashi
Ping-Ke Shih Nov. 22, 2021, 12:22 a.m. UTC | #3
> -----Original Message-----
> From: Takashi Iwai <tiwai@suse.de>
> Sent: Friday, November 19, 2021 9:57 PM
> To: Kalle Valo <kvalo@codeaurora.org>
> Cc: Pkshih <pkshih@realtek.com>; linux-wireless@vger.kernel.org; tiwai@suse.de;
> Larry.Finger@lwfinger.net
> Subject: Re: [PATCH v3 0/3] rtw89: fix crash when loading firmware file on certain platforms
> 
> On Fri, 19 Nov 2021 13:05:56 +0100,
> Kalle Valo wrote:
> >
> > Ping-Ke Shih <pkshih@realtek.com> writes:
> >
> > > First patch is to avoid writing "partition size" on read-only firmware
> > > buffer, so it has to fix the crash.
> > > The later two patches are used to make the semantics clear, but they don't
> > > change the logic at all.
> > >
> > > I hope at least first patch can be taken into 5.16-rc, so people can avoid
> > > this crash.
> >
> > My plan is to take patch 1 to wireless-drivers. And, after patch 1
> > trickles down to wireless-drivers-next, patch 2-3 to
> > wireless-drivers-next. Sounds good to everyone?
> 
> Yes, sounds like a good plan.
> 

I also agree with your plan.

--
Ping-Ke