All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Haoming Gao" <Naixumogu@whut.edu.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 3/3] accel/rocket: Propagate job submission errors
Date: Fri, 28 Aug 2026 06:59:03 +0000	[thread overview]
Message-ID: <20260828065903.B28511F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260828064152.37822-4-Naixumogu@whut.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Unbounded `job_count` allows memory exhaustion and memcg limit bypass (Denial of Service).
--

commit 25d3cd6d4d07a127ac97a2a68ff62409e8f7d1fd
Author: Haoming Gao <Naixumogu@whut.edu.cn>

accel/rocket: Propagate job submission errors

This commit modifies rocket_ioctl_submit() to return the first error
encountered during job submission and stops processing remaining jobs,
leaving previously queued jobs intact.

> diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> --- 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
>  	}
>  
>  
> -	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]
This isn't a bug introduced by this patch, but is it possible for an
unprivileged user to exhaust system memory here?

The loop iterates based on args->job_count without an apparent upper bound.
During each iteration, rocket_ioctl_submit_job() allocates struct rocket_job,
task arrays, and DRM scheduler objects.

Because these are allocated using kzalloc_obj and kvmalloc_objs (which
default to GFP_KERNEL without __GFP_ACCOUNT), they are not charged to the
caller's memory cgroup.

Could a user pass a massive job_count to the ioctl via the DRM render node
to bypass container limits and trigger a system-wide out of memory condition?

>  
>  exit:
>  	kvfree(jobs);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260828064152.37822-1-Naixumogu@whut.edu.cn?part=3

      reply	other threads:[~2026-08-28  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  6:41 [PATCH v5 0/3] accel/rocket: Fix job submit error handling Haoming Gao
2026-08-28  6:41 ` [PATCH v5 1/3] accel/rocket: Validate BO handle counts on job submission Haoming Gao
2026-08-28  6:58   ` sashiko-bot
2026-08-28  6:41 ` [PATCH v5 2/3] accel/rocket: Collect job dependencies before arming Haoming Gao
2026-08-28  6:55   ` sashiko-bot
2026-08-28  6:41 ` [PATCH v5 3/3] accel/rocket: Propagate job submission errors Haoming Gao
2026-08-28  6:59   ` 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=20260828065903.B28511F00A3A@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 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.