From: Changyul Lee <lcy8047@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Simon Ser <contact@emersion.fr>, Alex Hung <alex.hung@amd.com>,
Daniel Stone <daniels@collabora.com>,
Sebastian Wick <sebastian.wick@redhat.com>,
Melissa Wen <mwen@igalia.com>,
Harry Wentland <harry.wentland@amd.com>,
Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
Louis Chauvet <louis.chauvet@bootlin.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Changyul Lee <lcy8047@gmail.com>
Subject: [PATCH] drm/colorop: Release the object ID in drm_colorop_cleanup()
Date: Wed, 4 Nov 2026 19:18:15 -0500 [thread overview]
Message-ID: <20261105001815.4000596-1-lcy8047@gmail.com> (raw)
The drm_plane_colorop_*_init() functions add the colorop to the mode
object IDR, but drm_colorop_cleanup() does not remove it, unlike
drm_plane_cleanup(). When a driver frees a colorop after a failed
pipeline setup, its ID still points to the freed object.
vkms ignores the setup error and registers the device anyway, so the
stale ID can be looked up from userspace. With one allocation in
drm_plane_colorop_curve_1d_init() failed through failslab, querying
the IDs with DRM_IOCTL_MODE_OBJ_GETPROPERTIES gives:
BUG: KASAN: slab-use-after-free in __drm_mode_object_find+0x2e8/0x320
Read of size 4 at addr ffff88800b681020 by task getprops/79
Call Trace:
__drm_mode_object_find
drm_mode_obj_get_properties_ioctl
drm_ioctl_kernel
Call drm_mode_object_unregister() in drm_colorop_cleanup().
Fixes: 9cf87f864d83 ("drm/colorop: Add destroy functions for color pipeline")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
drivers/gpu/drm/drm_colorop.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 95da03d6c65c..edfb4d72d166 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -183,6 +183,8 @@ void drm_colorop_cleanup(struct drm_colorop *colorop)
if (colorop->state)
drm_colorop_atomic_destroy_state(colorop, colorop->state);
+
+ drm_mode_object_unregister(dev, &colorop->base);
}
EXPORT_SYMBOL(drm_colorop_cleanup);
base-commit: 3944ca3e6b7d25e545e8ef6498f69941e8e0c8ae
--
2.43.0
reply other threads:[~2026-11-05 0:18 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=20261105001815.4000596-1-lcy8047@gmail.com \
--to=lcy8047@gmail.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=sebastian.wick@redhat.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®