[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250708130114.GX1410929@nvidia.com>
Date: Tue, 8 Jul 2025 10:01:14 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Michael Margolin <mrgolin@...zon.com>
Cc: kees@...nel.org, linux-hardening@...r.kernel.org, gustavoars@...nel.org,
leon@...nel.org, sleybo@...zon.com, matua@...zon.com
Subject: Re: [PATCH][next] overflow: Add safe add/sub and compare helpers
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@...zon.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
Powered by blists - more mailing lists