[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d127e624d6a851f488c60631a9bf84f6316748eb@intel.com>
Date: Mon, 02 Jun 2025 16:10:21 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Kees Cook <kees@...nel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@...nel.org>,
linux-hardening@...r.kernel.org, intel-gfx@...ts.freedesktop.org
Subject: Re: i915 utils: range_overflows*()
On Fri, 30 May 2025, Kees Cook <kees@...nel.org> wrote:
> On Fri, May 30, 2025 at 10:44:31AM +0300, Jani Nikula wrote:
>>
>> Hi Kees -
>>
>> drivers/gpu/drm/i915/i915_utils.h has a handful of helper macros for
>> checking range overflows: range_overflows(), range_overflows_t(),
>> range_overflows_end(), and range_overflows_end_t().
>>
>> Looks like the first one has also been copy-pasted to
>> include/drm/drm_buddy.h.
>>
>> Feels like include/linux/overflow.h would be the right place for (some
>> version of) them.
>>
>> Thoughts?
>
> Sure, yes! They need some documentation too. :) And probably some
> renaming. It looks like range_overflows() is not end-inclusive, but
> range_overflows_end() is? And the _t variants are forcing explicit
> types (like max_t, but unlike struct_size_t).
Ah, naming.
As we all know, NP in NP-complete actually stands for "naming
problem". It's hard to come up with a good name, but presented with one,
it's quick to verify it is indeed good.
Ideas for the hard part?
BR,
Jani.
--
Jani Nikula, Intel
Powered by blists - more mailing lists