[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFhGd8oUjT3G7hvweWTtd3RLdQMBSjjVS6iHModQPf5VqU039w@mail.gmail.com>
Date: Mon, 6 May 2024 20:50:43 -0700
From: Justin Stitt <justinstitt@...gle.com>
To: Jens Axboe <axboe@...nel.dk>, Nathan Chancellor <nathan@...nel.org>, Bill Wendling <morbo@...gle.com>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH] block/ioctl: use overflow helper for blkpg_partition fields
On Mon, May 6, 2024 at 4:10 PM Justin Stitt <justinstitt@...gle.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
Powered by blists - more mailing lists