From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/i915: Fix potential overflow of shmem scatterlist length
Date: Fri, 27 Feb 2026 15:21:32 +1000 [thread overview]
Message-ID: <review-overall-20260224094944.2447913-2-janusz.krzysztofik@linux.intel.com> (raw)
In-Reply-To: <20260224094944.2447913-2-janusz.krzysztofik@linux.intel.com>
Overall Series Review
Subject: drm/i915: Fix potential overflow of shmem scatterlist length
Author: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Patches: 7
Reviewed: 2026-02-27T15:21:32.541027
---
This is a single-patch fix for a real overflow bug in the i915 shmem scatterlist allocation path. The `sg->length` field is `unsigned int` (32-bit), and when contiguous folios are coalesced into a single scatterlist entry, the accumulated length can overflow past 4GB. The bug was acknowledged by the original author with a `/* XXX: could overflow? */` comment but never fixed. The fix is targeted at the right code and the commit message, Fixes tag, stack trace, and Cc: stable are all correct.
However, the patch introduces a **new correctness issue**: when a folio must be split across two sg entries (because it straddles the `max_segment` boundary), the code re-fetches the same folio in the next loop iteration but maps it from offset 0, double-mapping the pages at the start of the folio while losing the pages at the tail. There is also a minor style concern with the use of `min_array` and a compound literal where `min3` would be more conventional.
**Verdict**: The fix addresses a real, triggerable bug but needs a respin to correctly handle partial-folio splits.
---
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-02-27 5:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 9:49 [PATCH] drm/i915: Fix potential overflow of shmem scatterlist length Janusz Krzysztofik
2026-02-25 14:41 ` Andi Shyti
2026-02-25 15:11 ` Janusz Krzysztofik
2026-02-25 15:38 ` Andi Shyti
2026-02-25 17:29 ` Janusz Krzysztofik
2026-02-26 12:23 ` Andi Shyti
2026-02-26 13:02 ` Sebastian Brzezinka
2026-02-27 5:21 ` Claude review: " Claude Code Review Bot
2026-02-27 5:21 ` Claude Code Review Bot [this message]
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=review-overall-20260224094944.2447913-2-janusz.krzysztofik@linux.intel.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox