public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Denis Sergeev <denserg.edu@gmail.com>,
	westeri@kernel.org, linusw@kernel.org,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler
Date: Tue, 27 Jan 2026 11:14:27 +0200	[thread overview]
Message-ID: <aXiB80UJamq0oeDr@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=MdRQzgSNorb9rHtAGWYPOK7t2o6q2gP9FLB3ECsvgVrAQ@mail.gmail.com>

On Tue, Jan 27, 2026 at 10:06:33AM +0100, Bartosz Golaszewski wrote:
> On Tue, Jan 27, 2026 at 9:08 AM Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> >
> > On Mon, Jan 26, 2026 at 06:59:14AM +0300, Denis Sergeev wrote:
> > > The BIT() macro uses unsigned long, which is 32 bits on 32-bit
> > > architectures. When iterating over GPIO pins with index >= 32,
> > > the expression (*value & BIT(i)) causes undefined behavior due
> > > to shifting by a value >= type width.
> > >
> > > Since 'value' is a pointer to u64, use BIT_ULL() to ensure correct
> > > 64-bit mask on all architectures.
> > >
> > > Found by Linux Verification Center (linuxtesting.org) with Svace.
> > >
> > > Fixes: 2c4d00cb8fc5 ("gpiolib: acpi: Use BIT() macro to increase readability")
> > > Signed-off-by: Denis Sergeev <denserg.edu@gmail.com>
> >
> > Reviewed-by: Mika Westerberg <westeri@kernel.org>
> 
> I'll queue this for v6.19-rc8.

This is half-baked solution... But okay, let's shut up at least the stream of
this type of "fixes" in this file.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-01-27  9:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26  3:59 [PATCH] gpiolib: acpi: use BIT_ULL() for u64 mask in address space handler Denis Sergeev
2026-01-27  8:07 ` Mika Westerberg
2026-01-27  9:06   ` Bartosz Golaszewski
2026-01-27  9:14     ` Andy Shevchenko [this message]
2026-01-27  9:09 ` Bartosz Golaszewski

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=aXiB80UJamq0oeDr@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=denserg.edu@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mika.westerberg@linux.intel.com \
    --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