From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/v3d: Limit ioctl extension chain depth to prevent infinite loop
Date: Sun, 12 Apr 2026 10:35:51 +1000 [thread overview]
Message-ID: <review-overall-20260410013907.2404175-1-ashutoshdesai993@gmail.com> (raw)
In-Reply-To: <20260410013907.2404175-1-ashutoshdesai993@gmail.com>
Overall Series Review
Subject: drm/v3d: Limit ioctl extension chain depth to prevent infinite loop
Author: Ashutosh Desai <ashutoshdesai993@gmail.com>
Patches: 2
Reviewed: 2026-04-12T10:35:51.967853
---
This is a single-patch fix for a real denial-of-service vulnerability in the V3D DRM driver. A userspace process can craft a self-referential ioctl extension chain (where `ext->next` points back to the extension itself) that causes `v3d_get_extensions()` to loop infinitely in kernel context, permanently pegging a CPU core.
The vulnerability analysis in the commit message is correct. The existing "duplicate guard" in `v3d_get_multisync_submit_deps()` (line 391) only checks `se->in_sync_count || se->out_sync_count`, and `v3d_get_multisync_post_deps()` returns immediately at line 340 when `count` is 0 without ever setting `se->out_sync_count`. So a crafted extension with `DRM_V3D_EXT_ID_MULTI_SYNC`, zero sync counts, and `next` pointing to itself will loop forever.
The fix is sound in principle — adding a depth limit is the standard defense used by both i915 (512) and xe (16). However, there are several issues that should be addressed before merging.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 0:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 1:39 [PATCH] drm/v3d: Limit ioctl extension chain depth to prevent infinite loop Ashutosh Desai
2026-04-10 18:16 ` Maíra Canal
2026-04-13 5:52 ` [PATCH v2] " Ashutosh Desai
2026-04-12 0:35 ` Claude Code Review Bot [this message]
2026-04-12 0:35 ` Claude review: " 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-20260410013907.2404175-1-ashutoshdesai993@gmail.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