From: sashiko-bot@kernel.org
To: "Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/sched: Switch the default policy to "fair"
Date: Tue, 10 Nov 2026 14:25:51 +0000 [thread overview]
Message-ID: <sashiko-outbox-207189@kernel.org> (raw)
In-Reply-To: <20261110141455.28739-1-tvrtko.ursulin@igalia.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/sched: ZERO_SIZE_PTR dereference in drm_sched_init() [1]
--
commit 50f60e38bc825925735e0e6bb31a4a450af5bbc2
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
drm/sched: Switch the default policy to "fair"
This commit changes the default DRM GPU scheduler policy from FIFO to
fair and updates the sched_policy module parameter description.
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 99252674e2668..a030061d0390c 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -83,13 +83,13 @@
> #define CREATE_TRACE_POINTS
> #include "gpu_scheduler_trace.h"
>
> -int drm_sched_policy = DRM_SCHED_POLICY_FIFO;
> +int drm_sched_policy = DRM_SCHED_POLICY_FAIR;
[Severity: High]
This problem wasn't introduced by this patch, but can drm_sched_init()
dereference ZERO_SIZE_PTR on sched->sched_rq [1] when
args->num_rqs is 0 under DRM_SCHED_POLICY_FAIR?
drivers/gpu/drm/scheduler/sched_main.c:drm_sched_init() {
...
sched->num_rqs = drm_sched_policy != DRM_SCHED_POLICY_FAIR ?
args->num_rqs : 1;
sched->sched_rq = kzalloc_objs(*sched->sched_rq, args->num_rqs);
if (!sched->sched_rq)
goto Out_check_own;
for (i = DRM_SCHED_PRIORITY_KERNEL; i < sched->num_rqs; i++) {
sched->sched_rq[i] = kzalloc_obj(*sched->sched_rq[i]);
...
}
When args->num_rqs is 0, it passes the upper-bound check against
DRM_SCHED_PRIORITY_COUNT, and kzalloc_objs() returns ZERO_SIZE_PTR while
sched->num_rqs is overridden to 1 for the fair policy, causing the loop
to dereference sched->sched_rq[0]. Should kzalloc_objs() use
sched->num_rqs instead of args->num_rqs?
[1] https://sashiko.dev/#/bug/linux-5fb1fd33-7544-4ca1-bec8-2b20739ac0dd
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110141455.28739-1-tvrtko.ursulin@igalia.com?part=1
next prev parent reply other threads:[~2026-11-10 14:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 14:14 [PATCH] drm/sched: Switch the default policy to "fair" Tvrtko Ursulin
2026-11-10 14:25 ` sashiko-bot [this message]
2026-11-10 14:28 ` Philipp Stanner
2026-11-11 11:15 ` Tvrtko Ursulin
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=sashiko-outbox-207189@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tvrtko.ursulin@igalia.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 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.