Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93838606A31C for ; Sun, 29 Nov 2026 07:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=J2WVln4h Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F1A810E110; Sun, 29 Nov 2026 07:04:59 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C80110E110 for ; Sun, 29 Nov 2026 07:04:52 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 47A58415C8; Sun, 29 Nov 2026 07:04:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14B1F1F00896; Sun, 29 Nov 2026 07:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795935892; bh=QmJ/nQD/ULpipOPpVS2olb7YdHWdot/x4W4joDDAHvo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=J2WVln4hDEtzWGQihxyXqIAAlVxr0eicamAqPWHwlIZMDmHrlBAvHT6tL4IVm/CsD Mm4xdKW6pyMepnbxKkRSjT7a6sK10P9rgibEC6B8FULDtGSGiSoCBDVVAZwoUE9SHz LTQgE7Bzen2s1/hgt1zesa1UIDjCs08Onvy2bYW3C5RI2Wn/YwVw1lkR0huH9fPItK HFNff7EEQ/W0FEW57hOTNOqN9AjeU9BWcmilFKosnbqxRrBUum9d3ROBW+oQpx1xMY Q/Sip0H5w6ifGT+Jq0jnnoI54jeSj9wO7ZHqfrTxO5kaLCmfYT5dzPmbeeJlk1jao0 NtRDoUWtpBexA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] accel/qaic: Hold bo->lock when checking bo->sliced and bo->dbc in qaic_wait_bo_ioctl() To: "Bilal Hashim" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261129065740.864-2-AeeSec@126.com> References: <20261129065740.864-1-AeeSec@126.com> <20261129065740.864-2-AeeSec@126.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 07:04:51 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 > accel/qaic: Hold bo->lock when checking bo->sliced and bo->dbc in qaic_wa= it_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 =3D NULL`) before > `qaic_init_bo(bo, true)` clears `bo->sliced =3D false`. A thread in > `qaic_wait_bo_ioctl()` can observe `bo->sliced =3D=3D 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 [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 IO= CTLs") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129065740.864-= 2-AeeSec@126.com?part=3D1