From: sashiko-bot@kernel.org
To: MoGGuU <Naixumogu@whut.edu.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 3/3] accel/rocket: Propagate job submission errors
Date: Fri, 28 Aug 2026 06:29:18 +0000 [thread overview]
Message-ID: <20260828062918.E1F1E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828061916.20405-4-Naixumogu@whut.edu.cn>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] The ioctl introduces ordered partial-submit semantics but fails to report how many jobs were successfully submitted, making error recovery impossible for userspace.
Pre-existing issues:
- [High] Unbounded memory allocation due to missing limit on args->job_count.
--
commit 41a2028e803565dfe6bad77987c577fafe68aee4
Author: MoGGuU <Naixumogu@whut.edu.cn>
accel/rocket: Propagate job submission errors
The patch updates rocket_ioctl_submit() to check the return value of each
job submission instead of discarding it. It now returns the first error
encountered and stops submitting the remaining jobs, providing ordered
partial-submit semantics.
> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> index 1634c30ede456..cd2ae1def74d1 100644
> --- a/drivers/accel/rocket/rocket_job.c
> +++ b/drivers/accel/rocket/rocket_job.c
> @@ -647,8 +647,11 @@ int rocket_ioctl_submit(struct drm_device *dev, void *data, struct drm_file *fil
> }
>
>
[Severity: High]
This is a pre-existing issue, but is there a missing limit on args->job_count
before the loop?
Looking at rocket_ioctl_submit(), there is an unbounded allocation based on
this user-controlled parameter earlier in the function:
jobs = kvmalloc_objs(*jobs, args->job_count);
if (!jobs) {
drm_dbg(dev, "Failed to allocate incoming job array\n");
return -ENOMEM;
}
Could an untrusted user supply a maliciously large args->job_count to cause
system memory exhaustion and invoke the OOM killer?
> - for (i = 0; i < args->job_count; i++)
> - rocket_ioctl_submit_job(dev, file, &jobs[i]);
> + for (i = 0; i < args->job_count; i++) {
> + ret = rocket_ioctl_submit_job(dev, file, &jobs[i]);
> + if (ret)
> + goto exit;
[Severity: High]
Does this code fail to report how many jobs were successfully submitted when
it aborts partially through?
When a job fails partway through the submission loop, the ioctl aborts and
propagates the error, leaving any previously queued jobs in place (ordered
partial-submit semantics). But without returning the progress state (e.g.,
which index failed) to userspace, doesn't this create an unrecoverable
job state ambiguity? If userspace retries, they might duplicate execution
of the already-submitted jobs.
> + }
>
> exit:
> kvfree(jobs);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828061916.20405-1-Naixumogu@whut.edu.cn?part=3
prev parent reply other threads:[~2026-08-28 6:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 6:19 [PATCH v4 0/3] accel/rocket: Fix job submit error handling MoGGuU
2026-08-28 6:19 ` [PATCH v4 1/3] accel/rocket: Validate BO handle counts on job submission MoGGuU
2026-08-28 6:33 ` Greg KH
2026-08-28 6:41 ` Haoming Gao
2026-08-28 6:35 ` sashiko-bot
2026-08-28 6:19 ` [PATCH v4 2/3] accel/rocket: Collect job dependencies before arming MoGGuU
2026-08-28 6:31 ` sashiko-bot
2026-08-28 6:19 ` [PATCH v4 3/3] accel/rocket: Propagate job submission errors MoGGuU
2026-08-28 6:29 ` sashiko-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=20260828062918.E1F1E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Naixumogu@whut.edu.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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