From nobody Fri Jul 24 21:53:41 2026 Received: from v-zimmta03.u-bordeaux.fr (smtp.u-bordeaux.fr [147.210.215.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 785AC3E49F7 for ; Thu, 23 Jul 2026 10:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=147.210.215.83 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784801406; cv=none; b=cwqim7F8t5xHsF3BqB3zuSFtYkr2lHseBRITVb4Wxlfl5BHQLVn7ghoZkbuuJsgB0GmeQKlegu2ADLoYojwg+n+4X9m0/uGkayCdaBMZt89GlvR7TTk4tcPBhGrXPFv9BSKwI9NrKPMV6YYKoMjKDXrSHWPMFWHFFkTqWy/+5TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784801406; c=relaxed/simple; bh=OB6EUIlRmEOmPaSSvisMPXn9bB2BTcXZbsLmFF3VCEA=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=CjEXZ+9cDZd0jwQXRjFWX34UJaVMgksIpqvt4FCaTQa0ox4YV91tm57lJDUp+K7gCm02LLVgzJBJet2Pw4k6dDscOzlNJz0vSBcuQGc6H5kLt9dVIXJvMx1BGslWT4hg2HIK2lzzlGRLd9+z3o1HmZknF0OHjP+5WBe8mGbYRMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u-bordeaux.fr; spf=pass smtp.mailfrom=u-bordeaux.fr; dkim=pass (2048-bit key) header.d=u-bordeaux.fr header.i=@u-bordeaux.fr header.b=aC9fw73w; arc=none smtp.client-ip=147.210.215.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u-bordeaux.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=u-bordeaux.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=u-bordeaux.fr header.i=@u-bordeaux.fr header.b="aC9fw73w" Received: from v-zimmta03.u-bordeaux.fr (localhost [127.0.0.1]) by v-zimmta03.u-bordeaux.fr (Postfix) with ESMTP id 389AB180416F; Thu, 23 Jul 2026 12:06:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u-bordeaux.fr; s=2025032601; t=1784801185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21cItyY5SVbKTkz7hNyqC7CX0qWcyQCvSirRm3tfbcY=; b=aC9fw73w0HBXPs4WYeNh203bQTTWdi1HkXTtcvRAiYMH/6LH3DPT6bXirMcC0UB1A1nk6p Cj9VLwLdNHtAtEQcHo7/I828DZeUT0G87J7q1vFbBMoEcFKowFHCish1pnYdXyvnaYC5BZ snAWnaE/0xxwBbdfd9RuXmz+BA8V4LdY16z+WOw71Nqzj4F8Kod1FcCOjBRkFl0wnyVaua KQR5UWZOMTNNuKItY5jbo5Shd8NoCfsZLPAZOITVoPP3ssq/LzdjDiKuWPffATErAYNGb+ NSvpX0t/iCHKV2vw8+q9JQ2/1axaGVOFM0EZRJXlRaxqRBQqhSSlLCqr4pRKcQ== Received: from [147.210.8.222] (callisto.labri.fr [147.210.8.222]) by v-zimmta03.u-bordeaux.fr (Postfix) with ESMTPSA id C9C58180416B; Thu, 23 Jul 2026 12:06:24 +0200 (CEST) Message-ID: <1690ea65-a1e0-4a34-bde1-bdd26e31c6c4@u-bordeaux.fr> Date: Thu, 23 Jul 2026 12:06:19 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, fr To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org Cc: Danilo Krummrich , David Airlie , Maarten Lankhorst , Maxime Ripard , Simona Vetter From: Emmanuel Fleury Subject: [PATCH] drm/nouveau: Fix NULL pointer dereference in nouveau_fence_sync() when prev->cli == NULL Content-Transfer-Encoding: quoted-printable X-AV-Checked: ClamAV using ClamSMTP Content-Type: text/plain; charset="utf-8"; format="flowed" I ran several times into a kernel oops caused by a NULL pointer dereference in nouveau_fence_sync(). The variable "prev" may be non-NULL while "prev->cli" is NULL, leading to an unconditional dereference of "prev->cli->drm". Prevent the dereference by checking "prev->cli" before accessing its "drm" field while preserving the existing logic. Fixes: 1f9910b41c857 ("nouveau/fence: handle cross device fences properly") Signed-off-by: Emmanuel Fleury --- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c=20 b/drivers/gpu/drm/nouveau/nouveau_fence.c index edbe9e08ba0f..90e6e89c0911 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -374,7 +374,7 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct=20 nouveau_channel *chan, rcu_read_lock(); prev =3D rcu_dereference(f->channel); - local =3D prev && prev->cli->drm =3D=3D chan->cli->drm; + local =3D prev && prev->cli && prev->cli->drm =3D=3D chan->cli->drm; if (local && (prev =3D=3D chan || fctx->sync(f, prev, chan) =3D=3D 0)) must_wait =3D false; --=20 2.53.0