Linux wireless drivers development
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Tianchu Chen <tianchu.chen@linux.dev>
Cc: linux-wireless@vger.kernel.org, francesco@dolcini.it
Subject: Re: [PATCH v2] wifi: mwifiex: bound SDIO fw dump count by memory table size
Date: Fri, 25 Sep 2026 15:36:12 -0700	[thread overview]
Message-ID: <arb3XMIIxzrGeGae@google.com> (raw)
In-Reply-To: <33a45fd59b5569cbce79142d2e012e191989ec26@linux.dev>

On Wed, Sep 23, 2026 at 02:43:51PM +0000, Tianchu Chen wrote:
> From: Tianchu Chen <flynnnchen@tencent.com>
> 
> mwifiex_sdio_fw_dump() reads the number of memory regions (dump_num)
> from a device register and uses it to index the static 15-entry
> mem_type_mapping_tbl[] without any bounds check.  A bogus device can
> report a dump_num larger than the table; each out-of-table loop
> iteration then reads entry->mem_name and entry->done_flag and stores
> a vmalloc pointer and a device-controlled size past the end of the
> table, into adjacent .data (up to ~5.6KiB when dump_num is 255).
> 
> The dump path runs after command timeouts or firmware crashes, so a
> bogus device can first force an error to trigger the dump and then
> report a bogus dump_num.
> 
> Limit dump_num to the table size instead of aborting the dump. This
> is not expected to change the behavior on normal devices.
> 
> Discovered by Atuin - Automated Vulnerability Discovery Engine.
> 
> Fixes: 54881c6b37c8d ("mwifiex: add firmware dump feature for SDIO")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Tianchu Chen <flynnnchen@tencent.com>
> ---
> v2: clamp dump_num to the table size and continue when bogus dump_num
> detected.

Oops, didn't notice v2 when reviewing v1. This is a valid choice too;
probably a better one.

Acked-by: Brian Norris <briannorris@chromium.org>

      reply	other threads:[~2026-09-25 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 14:43 [PATCH v2] wifi: mwifiex: bound SDIO fw dump count by memory table size Tianchu Chen
2026-09-25 22:36 ` Brian Norris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=arb3XMIIxzrGeGae@google.com \
    --to=briannorris@chromium.org \
    --cc=francesco@dolcini.it \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tianchu.chen@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox