From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E46404C97; Tue, 11 Nov 2025 00:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762822518; cv=none; b=cpcZntINILYkOywtPAfCoyKoMwwSx5WOFvdY6exF2gtKsODr84xP9HRtZCPMSKmQAeAJ/1vZ3lU6S1odVujk8yA6zsnIHDhnyEZY+r0j9OO/cXOrcdMuP29wPB1imIwnH1EvqwP6rmgOfRT74+rzEsseH8Hhj+i4XTVghSuoUIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762822518; c=relaxed/simple; bh=MeiCOYirxYR3uP+B/dzbVUNE5+aQug5PiSZDwp6VMA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e/8SekwR5FpWrolW/oWzzxC2dPJZW6UixlrilpfoHRnhRM1oC0RLSoznwbY5Dn29v1GpZ/6X2sGAVVBbvoEuk4u4RUVuDCnoOjh9fbTJBpZTblB01OKnYqvU48GpqEE0kZmRnhLXikQoN3C+gGltIOL5kAn7jdaJIo9WUbcPHvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0w5geyyp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0w5geyyp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 706D9C113D0; Tue, 11 Nov 2025 00:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762822517; bh=MeiCOYirxYR3uP+B/dzbVUNE5+aQug5PiSZDwp6VMA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0w5geyypRDguODmk9dcDi2AgcqosEDFaopDnjEadgiuSjro63zcyJXAp/p+udKRgH zZaoFuMUdGcFACAVKLC7KIGmHU9dwg63chBB6R1HaBTqTLAmM0I0iUAIiYOwAceHQs yoHdgO7JMoW0OzqWSaUu+T+crf9zfd1EycXm/3i0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Zimmermann , Dan Carpenter , Melissa Wen , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, Javier Martinez Canillas Subject: [PATCH 6.12 066/565] drm/sysfb: Do not dereference NULL pointer in plane reset Date: Tue, 11 Nov 2025 09:38:42 +0900 Message-ID: <20251111004528.430436499@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004526.816196597@linuxfoundation.org> References: <20251111004526.816196597@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Zimmermann commit 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 upstream. The plane state in __drm_gem_reset_shadow_plane() can be NULL. Do not deref that pointer, but forward NULL to the other plane-reset helpers. Clears plane->state to NULL. v2: - fix typo in commit description (Javier) Signed-off-by: Thomas Zimmermann Fixes: b71565022031 ("drm/gem: Export implementation of shadow-plane helpers") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/aPIDAsHIUHp_qSW4@stanley.mountain/ Cc: Thomas Zimmermann Cc: Melissa Wen Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Simona Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.15+ Reviewed-by: Javier Martinez Canillas Link: https://patch.msgid.link/20251017091407.58488-1-tzimmermann@suse.de Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_gem_atomic_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -309,8 +309,12 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_pla void __drm_gem_reset_shadow_plane(struct drm_plane *plane, struct drm_shadow_plane_state *shadow_plane_state) { - __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); - drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state); + if (shadow_plane_state) { + __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); + drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state); + } else { + __drm_atomic_helper_plane_reset(plane, NULL); + } } EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);