Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/sysfb: Do not dereference NULL pointer in plane reset" failed to apply to 6.1-stable tree

PATCH Applied [email protected] 3 participants 4 messages Nov 3, 2025 – Nov 4, 2025

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025110312-duration-shape-5d38@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <[email protected]>
Date: Fri, 17 Oct 2025 11:13:36 +0200
Subject: [PATCH] drm/sysfb: Do not dereference NULL pointer in plane reset

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)

Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Melissa Wen <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc <[email protected]> # v5.15+
drivers/gpu/drm/drm_gem_atomic_helper.c +6 -2
index ebf305fb24f0..6fb55601252f 100644
@@ -310,8 +310,12 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_plane_state);
 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);
 
maintainer
#1 lore raw

PATCH 1/1 drm/sysfb: Do not dereference NULL pointer in plane reset

From: Thomas Zimmermann <[email protected]>

[ Upstream commit 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 ]

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)

Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Melissa Wen <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc <[email protected]> # v5.15+
[ removed drm_format_conv_state_init() call ]
---
 drivers/gpu/drm/drm_gem_atomic_helper.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +5 -1
index b6a0110eb64af..2e658c216959f 100644
@@ -330,7 +330,11 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_plane_state);
 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);
+	if (shadow_plane_state) {
+		__drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base);
+	} else {
+		__drm_atomic_helper_plane_reset(plane, NULL);
+	}
 }
 EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);
 
Signature · 1 line
2.51.0
maintainer Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 6.1.y] drm/sysfb: Do not dereference NULL pointer in plane reset

Am 03.11.25 um 15:59 schrieb Sasha Levin:

Quoted 11 lines

From: Thomas Zimmermann <[email protected]>

[ Upstream commit 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 ]

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)

Quoted 16 lines
Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Melissa Wen <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc <[email protected]> # v5.15+
[ removed drm_format_conv_state_init() call ]
Quoted 21 lines
---
  drivers/gpu/drm/drm_gem_atomic_helper.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +5 -1
index b6a0110eb64af..2e658c216959f 100644
@@ -330,7 +330,11 @@ EXPORT_SYMBOL(drm_gem_destroy_shadow_plane_state);
  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);
+	if (shadow_plane_state) {
+		__drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base);
+	} else {
+		__drm_atomic_helper_plane_reset(plane, NULL);
+	}
  }
  EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);
 
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
author maintainer Applied
#3 lore raw

Patch "drm/sysfb: Do not dereference NULL pointer in plane reset" has been added to the 6.1-stable tree

In reply to Sasha Levin

This is a note to let you know that I've just added the patch titled

drm/sysfb: Do not dereference NULL pointer in plane reset

to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-sysfb-do-not-dereference-null-pointer-in-plane-reset.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Tue Nov 4 00:37:33 2025
From: Sasha Levin <[email protected]>
Date: Mon, 3 Nov 2025 09:59:11 -0500
Subject: drm/sysfb: Do not dereference NULL pointer in plane reset
To: [email protected]
Cc: Thomas Zimmermann <[email protected]>, Dan Carpenter <[email protected]>, Melissa Wen <[email protected]>, Maarten Lankhorst <[email protected]>, Maxime Ripard <[email protected]>, David Airlie <[email protected]>, Simona Vetter <[email protected]>, [email protected], Javier Martinez Canillas <[email protected]>, Sasha Levin <[email protected]>
Message-ID: <[email protected]>

From: Thomas Zimmermann <[email protected]>

[ Upstream commit 14e02ed3876f4ab0ed6d3f41972175f8b8df3d70 ]

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)

Fixes b71565022031 ("drm/gem: Export implementation of shadow-plane helpers")
Cc Thomas Zimmermann <[email protected]>
Cc Melissa Wen <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc <[email protected]> # v5.15+
[ removed drm_format_conv_state_init() call ]
---
 drivers/gpu/drm/drm_gem_atomic_helper.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +5 -1
@@ -330,7 +330,11 @@ 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);
+	if (shadow_plane_state) {
+		__drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base);
+	} else {
+		__drm_atomic_helper_plane_reset(plane, NULL);
+	}
 }
 EXPORT_SYMBOL(__drm_gem_reset_shadow_plane);
 

Patches currently in stable-queue which might be from [email protected] are

queue-6.1/bluetooth-hci-fix-tracking-of-advertisement-set-inst.patch queue-6.1/drm-amd-pm-powerplay-smumgr-fix-pciebootlinklevel-va.patch-16017 queue-6.1/drm-amd-pm-powerplay-smumgr-fix-pciebootlinklevel-va.patch queue-6.1/wifi-ath10k-fix-memory-leak-on-unsupported-wmi-comma.patch queue-6.1/x86-bugs-fix-reporting-of-lfence-retpoline.patch queue-6.1/dt-bindings-usb-dwc3-imx8mp-dma-range-is-required-only-for-imx8mp.patch queue-6.1/btrfs-use-smp_mb__after_atomic-when-forcing-cow-in-c.patch queue-6.1/arch-add-the-macro-compile_offsets-to-all-the-asm-of.patch queue-6.1/s390-pci-restore-irq-unconditionally-for-the-zpci-device.patch queue-6.1/xhci-dbc-improve-performance-by-removing-delay-in-transfer-event-polling.patch queue-6.1/asoc-fsl_sai-fix-bit-order-for-dsd-format.patch queue-6.1/edac-mc_sysfs-increase-legacy-channel-support-to-16.patch queue-6.1/net-hns3-return-error-code-when-function-fails.patch queue-6.1/btrfs-scrub-replace-max_t-min_t-with-clamp-in-scrub_.patch queue-6.1/xhci-dbc-poll-at-different-rate-depending-on-data-transfer-activity.patch queue-6.1/xhci-dbc-avoid-event-polling-busyloop-if-pending-rx-transfers-are-inactive.patch queue-6.1/serial-sc16is7xx-remove-unused-to_sc16is7xx_port-macro.patch queue-6.1/selftests-mptcp-join-mark-delete-re-add-signal-as-skipped-if-not-supported.patch queue-6.1/asoc-intel-avs-unprepare-a-stream-when-xrun-occurs.patch queue-6.1/mptcp-drop-bogus-optimization-in-__mptcp_check_push.patch queue-6.1/drm-etnaviv-fix-flush-sequence-logic.patch queue-6.1/serial-sc16is7xx-reorder-code-to-remove-prototype-declarations.patch queue-6.1/serial-sc16is7xx-refactor-efr-lock.patch queue-6.1/mptcp-pm-in-kernel-c-flag-handle-late-add_addr.patch queue-6.1/xhci-dbc-allow-users-to-modify-dbc-poll-interval-via-sysfs.patch queue-6.1/perf-have-get_perf_callchain-return-null-if-crosstas.patch queue-6.1/bluetooth-iso-fix-another-instance-of-dst_type-handl.patch queue-6.1/s390-pci-avoid-deadlock-between-pci-error-recovery-and-mlx5-crdump.patch queue-6.1/serial-sc16is7xx-remove-useless-enable-of-enhanced-features.patch queue-6.1/btrfs-zoned-refine-extent-allocator-hint-selection.patch queue-6.1/drm-msm-a6xx-fix-gmu-firmware-parser.patch queue-6.1/selftests-mptcp-disable-add_addr-retrans-in-endpoint_tests.patch queue-6.1/bluetooth-hci_sync-fix-race-in-hci_cmd_sync_dequeue_.patch queue-6.1/scsi-ufs-core-initialize-value-of-an-attribute-retur.patch queue-6.1/mptcp-change-first-as-a-parameter.patch queue-6.1/bluetooth-btmtksdio-add-pmctrl-handling-for-bt-close.patch queue-6.1/drm-sched-fix-race-in-drm_sched_entity_select_rq.patch queue-6.1/bpf-sync-pending-irq-work-before-freeing-ring-buffer.patch queue-6.1/alsa-usb-audio-fix-control-pipe-direction.patch queue-6.1/drm-sysfb-do-not-dereference-null-pointer-in-plane-reset.patch queue-6.1/btrfs-always-drop-log-root-tree-reference-in-btrfs_r.patch queue-6.1/drm-amd-pm-fix-smu-table-id-bound-check-issue-in-smu.patch queue-6.1/xhci-dbc-provide-sysfs-option-to-configure-dbc-descriptors.patch queue-6.1/bluetooth-iso-add-support-for-periodic-adv-reports-p.patch queue-6.1/usbnet-prevents-free-active-kevent.patch queue-6.1/xhci-dbc-fix-bogus-1024-byte-prefix-if-ttydbc-read-races-with-stall-event.patch queue-6.1/bpf-do-not-audit-capability-check-in-do_jit.patch queue-6.1/net-phy-dp83867-disable-eee-support-as-not-implemented.patch queue-6.1/libbpf-fix-powerpc-s-stack-register-definition-in-bp.patch