From: Jani Nikula <jani.nikula@intel.com>
To: Kees Cook <kees@kernel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-hardening@vger.kernel.org, intel-gfx@lists.freedesktop.org
Subject: Re: i915 utils: range_overflows*()
Date: Mon, 02 Jun 2025 16:10:21 +0300 [thread overview]
Message-ID: <d127e624d6a851f488c60631a9bf84f6316748eb@intel.com> (raw)
In-Reply-To: <202505301026.126AB6FFC@keescook>
On Fri, 30 May 2025, Kees Cook <kees@kernel.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
next prev parent reply other threads:[~2025-06-02 13:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 7:44 i915 utils: range_overflows*() Jani Nikula
2025-05-30 17:28 ` Kees Cook
2025-06-02 13:10 ` Jani Nikula [this message]
2025-06-02 18:20 ` Kees Cook
2025-06-04 8:59 ` [RFC] drm/i915/utils: document range_overflows*() macros Jani Nikula
2025-06-04 9:25 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2025-06-04 9:25 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-06-04 9:49 ` ✓ i915.CI.BAT: success " Patchwork
2025-06-04 11:23 ` ✗ i915.CI.Full: failure " Patchwork
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=d127e624d6a851f488c60631a9bf84f6316748eb@intel.com \
--to=jani.nikula@intel.com \
--cc=gustavoars@kernel.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.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