From: Marco Scardovi <scardracs@disroot.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <westeri@kernel.org>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] gpiolib: acpi: fix bounds-checking bugs in GPIO ACPI core
Date: Tue, 02 Jun 2026 09:59:34 +0200 [thread overview]
Message-ID: <2QvGwYNxRj2rEr3AgUt9Pg@disroot.org> (raw)
In-Reply-To: <ah6Lzn4NbilZQwvy@ashevche-desk.local>
In data martedì 2 giugno 2026 09:52:46 Ora legale dell’Europa centrale, Andy
Shevchenko ha scritto:
> On Sat, May 30, 2026 at 11:40:10AM +0200, Marco Scardovi wrote:
> > While reviewing drivers/gpio/gpiolib-acpi-core.c in linux-next,
> > I noticed two bounds-checking issues in the ACPI GPIO handling paths.
> >
> > The first issue is in acpi_gpio_adr_space_handler(), where the
> > 64-bit ACPI OperationRegion address is truncated to u16 before
> > validation against pin_table_length. This can cause out-of-range
> > addresses to wrap around and access unintended GPIO entries.
> >
> > Depending on platform firmware configuration, this could potentially
> > affect GPIO lines associated with sensitive hardware controls.
> >
> > The second issue is in acpi_gpio_package_count(), where malformed
> > _DSD packages can cause pointer advancement past the package end
> > during element parsing, potentially resulting in out-of-bounds reads.
> >
> > This series fixes both issues by:
> >
> > - Validating the full address range before truncation
> > - Making the length calculation overflow-safe
> > - Validating remaining package elements before pointer advancement
> >
> > The fixes are intentionally minimal and preserve the existing
> > behavior of capping ranges that extend past the end of the pin table.
> >
> > Patch 1 also converts the related loop variables to unsigned types
> > for consistency with the updated arithmetic.
>
> You got me lost. There was v3 of something, what is this?!
Hi Andy,
yes I messed up the patches on my side and made way too noise for my own, and
yours, peace of mind. Please don't consider this thread anymore.
prev parent reply other threads:[~2026-06-02 7:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 9:40 [PATCH 0/2] gpiolib: acpi: fix bounds-checking bugs in GPIO ACPI core Marco Scardovi
2026-05-30 9:40 ` [PATCH 1/2] gpiolib: acpi: prevent address truncation in OperationRegion handler Marco Scardovi
2026-06-01 5:02 ` Mika Westerberg
2026-06-01 6:31 ` Marco Scardovi
2026-05-30 9:40 ` [PATCH 2/2] gpiolib: acpi: fix out-of-bounds pointer arithmetic in acpi_gpio_package_count Marco Scardovi
2026-06-01 5:17 ` Mika Westerberg
2026-06-01 6:31 ` Marco Scardovi
2026-06-01 7:17 ` Mika Westerberg
2026-06-01 7:53 ` Marco Scardovi
2026-06-02 7:52 ` [PATCH 0/2] gpiolib: acpi: fix bounds-checking bugs in GPIO ACPI core Andy Shevchenko
2026-06-02 7:59 ` Marco Scardovi [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=2QvGwYNxRj2rEr3AgUt9Pg@disroot.org \
--to=scardracs@disroot.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=westeri@kernel.org \
/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