From: Jason Gunthorpe <jgg@nvidia.com>
To: Michael Margolin <mrgolin@amazon.com>
Cc: kees@kernel.org, linux-hardening@vger.kernel.org,
gustavoars@kernel.org, leon@kernel.org, sleybo@amazon.com,
matua@amazon.com
Subject: Re: [PATCH][next] overflow: Add safe add/sub and compare helpers
Date: Tue, 8 Jul 2025 10:01:14 -0300 [thread overview]
Message-ID: <20250708130114.GX1410929@nvidia.com> (raw)
In-Reply-To: <20250707201155.16874-1-mrgolin@amazon.com>
On Mon, Jul 07, 2025 at 08:11:55PM +0000, Michael Margolin wrote:
> Following a discussion on changes in RDMA subsystem [1], there is a use
> for helpers that allow overflow safe comparison between the result of a
> sum or a diff between two variables and some third operand. The classic
> use case is checking that end address is in range, given start address
> and length, but there are probably others. Add helpers that perform
> mathematically correct comparison regardles of the types being used.
>
> [1] https://lore.kernel.org/all/20250213144219.GB3754072@nvidia.com/
>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>
> ---
> include/linux/overflow.h | 34 ++++++++
> lib/tests/overflow_kunit.c | 171 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 205 insertions(+)
You should make this a series and add at least one user..
Jason
prev parent reply other threads:[~2025-07-08 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 20:11 [PATCH][next] overflow: Add safe add/sub and compare helpers Michael Margolin
2025-07-08 13:01 ` Jason Gunthorpe [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=20250708130114.GX1410929@nvidia.com \
--to=jgg@nvidia.com \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=leon@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=matua@amazon.com \
--cc=mrgolin@amazon.com \
--cc=sleybo@amazon.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.