Re: BUG: KASAN: vmalloc-out-of-bounds in mt7921_check_offload_capability+0x3fa/0x430 [mt7921_common]

From: Mikhail Gavrilov
Date: Mon Mar 20 2023 - 20:05:19 EST


On Mon, Mar 20, 2023 at 7:00 PM Ben Greear <greearb@xxxxxxxxxxxxxxx> wrote:
>
> On 3/20/23 03:32, Mikhail Gavrilov wrote:
> > Hi,
> > After enabling KASAN sanitizer the message "BUG: KASAN:
> > vmalloc-out-of-bounds in mt7921_check_offload_capability+0x3fa/0x430
> > [mt7921_common]" chase me at every boot.
>
> This is use-after-free bug, and I already posted a patch to fix it.
> "wireless: mt76: mt7921: Fix use-after-free in fw features query."

Hi,
This is the last version?
https://patchwork.kernel.org/project/linux-wireless/patch/20230308175832.2394061-1-greearb@xxxxxxxxxxxxxxx/

Unfortunately it is not applicable to 6.3-rc3.

❯ git apply v2-wireless-mt76-mt7921-Fix-use-after-free-in-fw-features-query..patch
-v
Checking patch drivers/net/wireless/mediatek/mt76/mt7921/init.c...
Hunk #1 succeeded at 171 (offset 6 lines).
Hunk #2 succeeded at 203 (offset 6 lines).
error: while searching for:

release_firmware(fw);

return features ? features->data : 0;
}
EXPORT_SYMBOL_GPL(mt7921_check_offload_capability);


error: patch failed: drivers/net/wireless/mediatek/mt76/mt7921/init.c:211
error: drivers/net/wireless/mediatek/mt76/mt7921/init.c: patch does not apply

--
Best Regards,
Mike Gavrilov.