mbox series

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

Message ID 20211112003453.5073-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. 12, 2021, 12:34 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.

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   | 1768 ++++++++++++---------
 drivers/net/wireless/realtek/rtw89/txrx.h |   46 +-
 4 files changed, 1370 insertions(+), 914 deletions(-)

Comments

Kalle Valo Nov. 12, 2021, 6:17 a.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.
>
> 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   | 1768 ++++++++++++---------
>  drivers/net/wireless/realtek/rtw89/txrx.h |   46 +-
>  4 files changed, 1370 insertions(+), 914 deletions(-)

Patch 1 should definitely go to wireless-drivers to fix the crash. But
I'm not sure about patches 2-3, they are quite large, and more like
cleanup than fixes, so wireless-drivers-next sounds more approriate to
me. But I can't decide, any thoughts on this?
Ping-Ke Shih Nov. 12, 2021, 6:44 a.m. UTC | #2
> -----Original Message-----
> From: kvalo=codeaurora.org@mg.codeaurora.org <kvalo=codeaurora.org@mg.codeaurora.org> On Behalf Of Kalle
> Valo
> Sent: Friday, November 12, 2021 2:17 PM
> To: Pkshih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org; tiwai@suse.de; Larry.Finger@lwfinger.net
> Subject: Re: [PATCH v2 0/3] rtw89: fix crash when loading firmware file on certain platforms
> 
> 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.
> >
> > 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   | 1768 ++++++++++++---------
> >  drivers/net/wireless/realtek/rtw89/txrx.h |   46 +-
> >  4 files changed, 1370 insertions(+), 914 deletions(-)
> 
> Patch 1 should definitely go to wireless-drivers to fix the crash. But
> I'm not sure about patches 2-3, they are quite large, and more like
> cleanup than fixes, so wireless-drivers-next sounds more approriate to
> me. But I can't decide, any thoughts on this?

Without patches 2-3, "future" hotfixes may be hard to merge, but
I don't know if it will happen. My question is how I can deal with
hotfix that can't auto merge; maybe, I can prepare separate patch,
correct? If so, I think we can only take patch 1 to wireless-drivers.

--
Ping-Ke