From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Kumar, Kaushlendra" <kaushlendra.kumar@intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
"joonas.lahtinen@linux.intel.com"
<joonas.lahtinen@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: RE: [PATCH] drm/i915: Prevent heap overflow in i915_l3_write()
Date: Wed, 28 Jan 2026 15:00:49 +0200 [thread overview]
Message-ID: <6aae6c8a4299b17a68cf5efd5faef21911daa688@intel.com> (raw)
In-Reply-To: <LV3PR11MB8768CDDC426609842C4AB789F591A@LV3PR11MB8768.namprd11.prod.outlook.com>
On Wed, 28 Jan 2026, "Kumar, Kaushlendra" <kaushlendra.kumar@intel.com> wrote:
> On Wed, 28 Jan 2026, Jani Nikula <jani.nikula@intel.com> wrote:
>> On Wed, 28 Jan 2026, Kaushlendra Kumar <kaushlendra.kumar@intel.com> wrote:
>>> + count = min_t(size_t, GEN7_L3LOG_SIZE - offset, count);
>>
>> This may make count not be a multiple of sizeof(u32) again. Note how
>> offset is treated below.
>
> Thank you for catching this!
>
> You're absolutely right about the alignment concern. While technically
> in this specific case (GEN7_L3LOG_SIZE = 0x80, and offset is already
> validated to be u32-aligned by l3_access_valid()), the subtraction
> (GEN7_L3LOG_SIZE - offset) would always yield a u32-aligned result.
>
> Anything I am missing here?
No, I missed that l3_access_valid() ensures offset is already aligned.
The whole thing is a bit too convoluted for my liking, but the whole
thing matches i915_l3_read() with this patch, and there's no value in
iterating this further.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-01-28 13:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 5:11 [PATCH] drm/i915: Prevent heap overflow in i915_l3_write() Kaushlendra Kumar
2026-01-28 7:06 ` ✓ i915.CI.BAT: success for " Patchwork
2026-01-28 10:50 ` [PATCH] " Jani Nikula
2026-01-28 11:27 ` Kumar, Kaushlendra
2026-01-28 13:00 ` Jani Nikula [this message]
2026-03-23 15:00 ` Kumar, Kaushlendra
2026-01-28 14:16 ` ✗ i915.CI.Full: failure for " 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=6aae6c8a4299b17a68cf5efd5faef21911daa688@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kaushlendra.kumar@intel.com \
--cc=rodrigo.vivi@intel.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.