From: Greg KH <gregkh@linuxfoundation.org>
To: w15303746062@163.com
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, kees@kernel.org,
stable@vger.kernel.org,
Mingyu Wang <25181214217@stu.xidian.edu.cn>
Subject: Re: [PATCH v2] misc: ibmasm: Fix static and dynamic out-of-bounds MMIO accesses
Date: Tue, 23 Jun 2026 13:53:30 +0200 [thread overview]
Message-ID: <2026062354-quote-lullaby-85e3@gregkh> (raw)
In-Reply-To: <20260623114046.368089-1-w15303746062@163.com>
On Tue, Jun 23, 2026 at 07:40:46PM +0800, w15303746062@163.com wrote:
> From: Mingyu Wang <25181214217@stu.xidian.edu.cn>
>
> The ibmasm driver maps PCI BAR 0 without verifying if the hardware-provided
> resource length is sufficient.
>
> When evaluating the driver against emulated hardware or during virtual
> device fuzzing, a malformed device may expose a significantly undersized
> BAR 0. This leads to two distinct out-of-bounds (OOB) MMIO access vectors:
>
> 1. Static OOB: The driver hardcodes access to INTR_CONTROL_REGISTER
> (offset 0x13A4) during probe.
> 2. Dynamic OOB: The driver reads dynamic Message Frame Addresses (MFA)
> from hardware queues and uses them directly as offsets to dereference
> I2O messages via get_i2o_message(). A malicious MFA can cause the
> driver to access memory far beyond the mapped BAR.
>
> If an OOB access triggers a #PF during module probe while holding the
> idempotent_init_module() lock, it leaves the module loading subsystem
> in a corrupted state, leading to a cascading global soft lockup.
>
> Fix this comprehensively by:
> - Storing the mapped resource size in 'struct service_processor'.
> - Ensuring the BAR size covers the highest statically accessed register
> (INTR_CONTROL_REGISTER) during probe.
> - Validating all dynamic MFA offsets against the mapped size before
> dereferencing to prevent dynamic OOB accesses.
>
> Fixes: bdbeed75b288 ("pci: use pci_ioremap_bar() in drivers/misc")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>
> ---
> Changes in v2:
> - Added dynamic MFA bounds checking in get_i2o_message() to prevent runtime OOB (prompted by Greg KH).
> - Implemented hardware mailbox deadlock prevention by releasing MFA if bounds check fails.
> - Fixed potential unsigned integer underflow in bounds check arithmetic.
That's a lot of different things all at once here. Please split this up
into a patch series, doing only one logical thing per patch so it is
easier to review and apply.
thanks,
greg k-h
next prev parent reply other threads:[~2026-06-23 11:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 7:09 [PATCH] misc: ibmasm: Fix out-of-bounds MMIO access during module load w15303746062
2026-06-23 7:16 ` Greg KH
2026-06-23 11:40 ` [PATCH v2] misc: ibmasm: Fix static and dynamic out-of-bounds MMIO accesses w15303746062
2026-06-23 11:53 ` Greg KH [this message]
2026-06-23 12:00 ` Mingyu Wang
2026-06-23 11:47 ` [PATCH] misc: ibmasm: Fix out-of-bounds MMIO access during module load Mingyu Wang
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=2026062354-quote-lullaby-85e3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=25181214217@stu.xidian.edu.cn \
--cc=arnd@arndb.de \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=w15303746062@163.com \
/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