Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Justin Stitt <justinstitt@google.com>
To: Jens Axboe <axboe@kernel.dk>,
	Nathan Chancellor <nathan@kernel.org>,
	Bill Wendling <morbo@google.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	 llvm@lists.linux.dev
Subject: Re: [PATCH] block/ioctl: use overflow helper for blkpg_partition fields
Date: Mon, 6 May 2024 20:50:43 -0700	[thread overview]
Message-ID: <CAFhGd8oUjT3G7hvweWTtd3RLdQMBSjjVS6iHModQPf5VqU039w@mail.gmail.com> (raw)
In-Reply-To: <20240506-b4-sio-block-ioctl-v1-1-da535cc020dc@google.com>

On Mon, May 6, 2024 at 4:10 PM Justin Stitt <justinstitt@google.com> wrote:
>
...
>
> Historically, the signed integer overflow sanitizer did not work in the
> kernel due to its interaction with `-fwrapv` but this has since been
> changed [1] in the newest version of Clang; It being re-enabled in the
> kernel with Commit 557f8c582a9ba8ab ("ubsan: Reintroduce signed overflow
> sanitizer").
>
> Let's use check_add_overflow to check for overflow between p.start and
> p.length, as this method won't trigger a UBSAN splat.

Whoops, I got this wrong. The third argument is where the result of
the summation is stored. In an effort not to use a throwaway variable
during testing I just used the address of p.start, this is clearly
wrong. I've changed my approach in [v2].

[v2]: https://lore.kernel.org/all/20240507-b4-sio-block-ioctl-v2-1-e11113aeb10f@google.com/


Thanks
Justin

      parent reply	other threads:[~2024-05-07  3:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 23:10 [PATCH] block/ioctl: use overflow helper for blkpg_partition fields Justin Stitt
2024-05-06 23:16 ` Justin Stitt
2024-05-07  3:50 ` Justin Stitt [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=CAFhGd8oUjT3G7hvweWTtd3RLdQMBSjjVS6iHModQPf5VqU039w@mail.gmail.com \
    --to=justinstitt@google.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).