public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH] workqueue: Fix UBSAN 'subtraction overflow' error in shift_and_mask()
Date: Tue, 30 Jul 2024 11:36:41 -1000	[thread overview]
Message-ID: <Zqlc6V0ZE6u9IgOu@slm.duckdns.org> (raw)
In-Reply-To: <20240730114431.1119-1-will@kernel.org>

On Tue, Jul 30, 2024 at 12:44:31PM +0100, Will Deacon wrote:
...
> This is due to shift_and_mask() using a signed immediate to construct
> the mask and being called with a shift of 31 (WORK_OFFQ_POOL_SHIFT) so
> that it ends up decrementing from INT_MIN.
> 
> Use an unsigned constant '1U' to generate the mask in shift_and_mask().
> 
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> Fixes: 1211f3b21c2a ("workqueue: Preserve OFFQ bits in cancel[_sync] paths")
> Signed-off-by: Will Deacon <will@kernel.org>

Applied to wq/for-6.11-fixes.

Thanks.

-- 
tejun

      reply	other threads:[~2024-07-30 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 11:44 [PATCH] workqueue: Fix UBSAN 'subtraction overflow' error in shift_and_mask() Will Deacon
2024-07-30 21:36 ` Tejun Heo [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=Zqlc6V0ZE6u9IgOu@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@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