lkml.org 
[lkml]   [2021]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rtw89: Fix crash by loading compressed firmware file
On Fri, 05 Nov 2021 09:25:13 +0100,
Kalle Valo wrote:
>
> Takashi Iwai <tiwai@suse.de> writes:
>
> > On Fri, 05 Nov 2021 08:17:25 +0100,
> > Takashi Iwai wrote:
> >>
> >> When a firmware is loaded in the compressed format or via user-mode
> >> helper, it's mapped in read-only, and the rtw89 driver crashes at
> >> rtw89_fw_download() when it tries to modify some data.
> >>
> >> This patch is an attemp to avoid the crash by re-allocating the data
> >> via vmalloc() for the data modification.
> >
> > Alternatively, we may drop the code that modifies the loaded firmware
> > data? At least SET_FW_HDR_PART_SIZE() in rtw89_fw_hdr_parser() looks
> > writing it, and I have no idea why this overwrite is needed.
>
> Strange, isn't the firmware data marked as const just to avoid this kind
> of problem? Does rtw89 have wrong casts somewhere which removes the
> const?

Yes. SET_FW_HDR_PART_SIZE() does the cast, dropping the const.


thanks,

Takashi

\
 
 \ /
  Last update: 2021-11-05 09:41    [W:0.082 / U:2.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site