From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe: use krealloc_array to prevent integer overflow
Date: Sun, 12 Apr 2026 11:54:39 +1000 [thread overview]
Message-ID: <review-overall-20260409012520.3531256-1-baoli.zhang@linux.intel.com> (raw)
In-Reply-To: <20260409012520.3531256-1-baoli.zhang@linux.intel.com>
Overall Series Review
Subject: drm/xe: use krealloc_array to prevent integer overflow
Author: "Baoli.Zhang" <baoli.zhang@linux.intel.com>
Patches: 1
Reviewed: 2026-04-12T11:54:39.270190
---
This is a single patch (v2) that mechanically replaces `krealloc()` with `krealloc_array()` in two xe driver files to leverage the built-in overflow checking in `krealloc_array()`. The change is correct, low-risk, and follows established kernel conventions. The kernel provides `krealloc_array()` specifically for this pattern — separating count from element size so the allocator can check for multiplication overflow internally.
The practical overflow risk here is low (especially in `xe_vm_madvise.c` where `max_vmas` starts at 8 and doubles, so it would OOM long before overflowing), but using the safe API is the right thing to do as a defense-in-depth measure. In `xe_configfs.c`, `count` is a `ssize_t` derived from user-supplied configfs input, so the overflow protection is slightly more meaningful there.
**Verdict: Looks good.** Minor nits below but nothing blocking.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 1:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 1:25 [PATCH v2] drm/xe: use krealloc_array to prevent integer overflow Baoli.Zhang
2026-04-12 1:54 ` Claude Code Review Bot [this message]
2026-04-12 1:54 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-23 12:00 [PATCH v1] " Baoli.Zhang
2026-03-24 21:53 ` Claude review: " Claude Code Review Bot
2026-03-24 21:53 ` Claude Code Review Bot
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-20260409012520.3531256-1-baoli.zhang@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