From: Kees Cook <kees@kernel.org>
To: Jani Nikula <jani.nikula@intel.com>
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: Fri, 30 May 2025 10:28:40 -0700 [thread overview]
Message-ID: <202505301026.126AB6FFC@keescook> (raw)
In-Reply-To: <cd0ea72c6cab6c478336cd1bb5b517a9fe7a150d@intel.com>
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).
--
Kees Cook
next prev parent reply other threads:[~2025-05-30 17:28 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 [this message]
2025-06-02 13:10 ` Jani Nikula
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=202505301026.126AB6FFC@keescook \
--to=kees@kernel.org \
--cc=gustavoars@kernel.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--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