public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/kmscon] rawhide: kmscon: Fix crash when a drm plane has no properties
Date: Mon, 05 Oct 2026 08:32:13 GMT	[thread overview]
Message-ID: <179118913391.1.10410409398562714996.rpms-kmscon-b36697a7985e@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/kmscon
            Branch : rawhide
            Commit : b36697a7985e66d91aa8c1b861c889052c4ca9ac
            Author : Jocelyn Falempe <jfalempe@redhat.com>
            Date   : 2026-10-05T10:31:25+02:00
            Stats  : +44/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/kmscon/c/b36697a7985e66d91aa8c1b861c889052c4ca9ac?branch=rawhide

            Log:
            kmscon: Fix crash when a drm plane has no properties

This can occur with kernel 7.3 and newer.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>

---
diff --git a/drm_shared-Fix-crash-if-a-plane-has-no-properties.patch b/drm_shared-Fix-crash-if-a-plane-has-no-properties.patch
new file mode 100644
index 0000000..b533750
--- /dev/null
+++ b/drm_shared-Fix-crash-if-a-plane-has-no-properties.patch
@@ -0,0 +1,42 @@
+From 77e6ced76709fc53ee1d9c9368d62ff65d971f26 Mon Sep 17 00:00:00 2001
+From: Jocelyn Falempe <jfalempe@redhat.com>
+Date: Sat, 3 Oct 2026 00:28:01 +0200
+Subject: [PATCH] drm_shared: Fix crash if a plane has no properties
+
+When testing newer kernel 7.3.0, it can happen that a plane has no
+properties at all.
+Check that there are properties before iterating on them.
+
+Also fix the same problem for the cursor plane
+
+Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
+---
+ src/video/drm_shared.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/video/drm_shared.c b/src/video/drm_shared.c
+index e4fd870..bb5c3f7 100644
+--- a/src/video/drm_shared.c
++++ b/src/video/drm_shared.c
+@@ -255,6 +255,9 @@ static int modeset_find_plane(int fd, struct display *disp)
+ 			drmModeObjectPropertiesPtr props =
+ 				drmModeObjectGetProperties(fd, plane_id, DRM_MODE_OBJECT_PLANE);
+ 
++			if (!props)
++				continue;
++
+ 			plane_type = get_property_value(fd, props, "type");
+ 			if (!found_primary && plane_type == DRM_PLANE_TYPE_PRIMARY) {
+ 				found_primary = true;
+@@ -311,7 +314,7 @@ static void modeset_clear_cursor(drmModeAtomicReq *req, int fd)
+ 		}
+ 		drmModeObjectPropertiesPtr props =
+ 			drmModeObjectGetProperties(fd, plane_id, DRM_MODE_OBJECT_PLANE);
+-		if (get_property_value(fd, props, "type") == DRM_PLANE_TYPE_CURSOR) {
++		if (props && get_property_value(fd, props, "type") == DRM_PLANE_TYPE_CURSOR) {
+ 			uint32_t prop_id = get_property_id(fd, props, "CRTC_ID");
+ 
+ 			if (drmModeAtomicAddProperty(req, plane_id, prop_id, 0) < 0)
+-- 
+2.55.0
+

diff --git a/kmscon.spec b/kmscon.spec
index 22b023b..2aa7359 100644
--- a/kmscon.spec
+++ b/kmscon.spec
@@ -33,6 +33,8 @@ Recommends:     (kmscon-freetype if freetype)
 
 # Upstream patch to prevent running kmscon.service when VTs are enabled
 Patch1: systemd-prevent-kmscon.service-to-run-if-dev-tty0-is.patch
+# Upstream patch, prevent crash on kernel 7.3+
+Patch2: drm_shared-Fix-crash-if-a-plane-has-no-properties.patch
 
 %description
 Kmscon is a simple terminal emulator based on linux kernel mode setting (KMS).

                 reply	other threads:[~2026-10-05  8:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179118913391.1.10410409398562714996.rpms-kmscon-b36697a7985e@fedoraproject.org \
    --to=jfalempe@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /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