dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bilal Hashim" <AeeSec@126.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/qaic: Hold bo->lock when checking bo->sliced and bo->dbc in qaic_wait_bo_ioctl()
Date: Sun, 29 Nov 2026 07:04:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-239356@kernel.org> (raw)
In-Reply-To: <20261129065740.864-2-AeeSec@126.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/qaic: missing Fixes trailer for commit d48ea8691943 in
  qaic_wait_bo_ioctl()
--

commit 24be64e6b07142c24440e91100eb34ff1186347a
Author: Bilal Hashim <AeeSec@126.com>

> accel/qaic: Hold bo->lock when checking bo->sliced and bo->dbc in qaic_wait_bo_ioctl()
>
> In `qaic_wait_bo_ioctl()`, `bo->sliced` and `bo->dbc->id` are read
> without holding `bo->lock`.
>
> Concurrently, `qaic_detach_slice_bo_ioctl()` calls `detach_slice_bo()`,
> which invokes `qaic_unprepare_bo()` (setting `bo->dbc = NULL`) before
> `qaic_init_bo(bo, true)` clears `bo->sliced = false`. A thread in
> `qaic_wait_bo_ioctl()` can observe `bo->sliced == true` and then
> dereference `bo->dbc->id` after `bo->dbc` has been cleared to `NULL`,
> triggering a NULL pointer dereference.
>
> Look up the GEM object and validate `bo->sliced` and `bo->dbc->id` under
> `bo->lock` before acquiring `dbc->ch_lock` (preserving lock ordering
> with `qaic_attach_slice_bo_ioctl()` and `qaic_detach_slice_bo_ioctl()`),
> then release `bo->lock` before sleeping in
> `wait_for_completion_interruptible_timeout()`.
>
> Found by manual code inspection.
>
> Signed-off-by: Bilal Hashim <AeeSec@126.com>

[Severity: Low]
This fixes the unlocked checks of bo->sliced and bo->dbc->id added in
qaic_wait_bo_ioctl() by commit d48ea8691943 ("accel/qaic: Harden checks in
BO execute and wait IOCTLs").  Should this include:

  Fixes: d48ea8691943 ("accel/qaic: Harden checks in BO execute and wait IOCTLs")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129065740.864-2-AeeSec@126.com?part=1

  reply	other threads:[~2026-11-29  7:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  6:57 [PATCH] accel/qaic: Synchronize access to dbc->bo_lists Bilal Hashim
2026-11-29  6:57 ` [PATCH] accel/qaic: Hold bo->lock when checking bo->sliced and bo->dbc in qaic_wait_bo_ioctl() Bilal Hashim
2026-11-29  7:04   ` sashiko-bot [this message]
2026-11-29  7:10 ` [PATCH] accel/qaic: Synchronize access to dbc->bo_lists sashiko-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=sashiko-outbox-239356@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=AeeSec@126.com \
    --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