* [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
[not found] <20250528091307.1894940-1-simona.vetter@ffwll.ch>
@ 2025-05-28 9:12 ` Simona Vetter
2025-05-28 9:26 ` Simona Vetter
` (2 more replies)
2025-05-28 9:13 ` [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats() Simona Vetter
1 sibling, 3 replies; 10+ messages in thread
From: Simona Vetter @ 2025-05-28 9:12 UTC (permalink / raw)
To: DRI Development
Cc: intel-xe, Simona Vetter, Jacek Lawrynowicz, stable,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Simona Vetter
Object creation is a careful dance where we must guarantee that the
object is fully constructed before it is visible to other threads, and
GEM buffer objects are no difference.
Final publishing happens by calling drm_gem_handle_create(). After
that the only allowed thing to do is call drm_gem_object_put() because
a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
(which is trivial since we have a linear allocator) can already tear
down the object again.
Luckily most drivers get this right, the very few exceptions I've
pinged the relevant maintainers for. Unfortunately we also need
drm_gem_handle_create() when creating additional handles for an
already existing object (e.g. GETFB ioctl or the various bo import
ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
the only exported function to stop these issues from happening.
Now unfortunately the implementation of drm_gem_handle_create() isn't
living up to standards: It does correctly finishe object
initialization at the global level, and hence is safe against a
concurrent tear down. But it also sets up the file-private aspects of
the handle, and that part goes wrong: We fully register the object in
the drm_file.object_idr before calling drm_vma_node_allow() or
obj->funcs->open, which opens up races against concurrent removal of
that handle in drm_gem_handle_delete().
Fix this with the usual two-stage approach of first reserving the
handle id, and then only registering the object after we've completed
the file-private setup.
Jacek reported this with a testcase of concurrently calling GEM_CLOSE
on a freshly-created object (which also destroys the object), but it
should be possible to hit this with just additional handles created
through import or GETFB without completed destroying the underlying
object with the concurrent GEM_CLOSE ioctl calls.
Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
Release driver references to handle before making it available
again"), which means a cool 9 years have passed until someone noticed
that we need to make this symmetry or there's still gaps left :-/
Without the 2-stage close approach we'd still have a race, therefore
that's an integral part of this bugfix.
More importantly, this means we can have NULL pointers behind
allocated id in our drm_file.object_idr. We need to check for that
now:
- drm_gem_handle_delete() checks for ERR_OR_NULL already
- drm_gem.c:object_lookup() also chekcs for NULL
- drm_gem_release() should never be called if there's another thread
still existing that could call into an IOCTL that creates a new
handle, so cannot race. For paranoia I added a NULL check to
drm_gem_object_release_handle() though.
- most drivers (etnaviv, i915, msm) are find because they use
idr_find, which maps both ENOENT and NULL to NULL.
- vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
pointers might exist due to drm_gem_handle_delete(). This needs a
separate patch. This is because idr_for_each_entry terminates on the
first NULL entry and so might not iterate over everything.
- similar for amd in amdgpu_debugfs_gem_info_show() and
amdgpu_gem_force_release(). The latter is really questionable though
since it's a best effort hack and there's no way to close all the
races. Needs separate patches.
- xe is really broken because it not uses idr_for_each_entry() but
also drops the drm_file.table_lock, which can wreak the idr iterator
state if you're unlucky enough. Maybe another reason to look into
the drm fdinfo memory stats instead of hand-rolling too much.
- drm_show_memory_stats() is also broken since it uses
idr_for_each_entry. But since that's a preexisting bug I'll follow
up with a separate patch.
Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Cc: stable@vger.kernel.org
Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
---
drivers/gpu/drm/drm_gem.c | 10 +++++++++-
include/drm/drm_file.h | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 1e659d2660f7..e4e20dda47b1 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
struct drm_file *file_priv = data;
struct drm_gem_object *obj = ptr;
+ if (WARN_ON(!data))
+ return 0;
+
if (obj->funcs->close)
obj->funcs->close(obj, file_priv);
@@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
idr_preload(GFP_KERNEL);
spin_lock(&file_priv->table_lock);
- ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
+ ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
spin_unlock(&file_priv->table_lock);
idr_preload_end();
@@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
goto err_revoke;
}
+ /* mirrors drm_gem_handle_delete to avoid races */
+ spin_lock(&file_priv->table_lock);
+ obj = idr_replace(&file_priv->object_idr, obj, handle);
+ WARN_ON(obj != NULL);
+ spin_unlock(&file_priv->table_lock);
*handlep = handle;
return 0;
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 5c3b2aa3e69d..d344d41e6cfe 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -300,6 +300,9 @@ struct drm_file {
*
* Mapping of mm object handles to object pointers. Used by the GEM
* subsystem. Protected by @table_lock.
+ *
+ * Note that allocated entries might be NULL as a transient state when
+ * creating or deleting a handle.
*/
struct idr object_idr;
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()
[not found] <20250528091307.1894940-1-simona.vetter@ffwll.ch>
2025-05-28 9:12 ` [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail() Simona Vetter
@ 2025-05-28 9:13 ` Simona Vetter
2025-05-28 9:22 ` Simona Vetter
2025-05-28 20:10 ` kernel test robot
1 sibling, 2 replies; 10+ messages in thread
From: Simona Vetter @ 2025-05-28 9:13 UTC (permalink / raw)
To: DRI Development
Cc: intel-xe, Simona Vetter, Rob Clark, Emil Velikov, Tvrtko Ursulin,
stable, Simona Vetter
Unlike idr_for_each_entry(), which terminates on the first NULL entry,
idr_for_each passes them through. This fixes potential issues with the
idr walk terminating prematurely due to transient NULL entries the
exist when creating and destroying a handle.
Note that transient NULL pointers in drm_file.object_idr have been a
thing since f6cd7daecff5 ("drm: Release driver references to handle
before making it available again"), this is a really old issue.
Aside from temporarily inconsistent fdinfo statistic there's no other
impact of this issue.
Fixes: 686b21b5f6ca ("drm: Add fdinfo memory stats")
Cc: Rob Clark <robdclark@chromium.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v6.5+
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
---
drivers/gpu/drm/drm_file.c | 95 ++++++++++++++++++++++----------------
1 file changed, 55 insertions(+), 40 deletions(-)
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 246cf845e2c9..428a4eb85e94 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -892,6 +892,58 @@ void drm_print_memory_stats(struct drm_printer *p,
}
EXPORT_SYMBOL(drm_print_memory_stats);
+struct drm_bo_print_data {
+ struct drm_memory_stats status;
+ enum drm_gem_object_status supported_status;
+};
+
+static int
+drm_bo_memory_stats(int id, void *ptr, void *data)
+{
+ struct drm_bo_print_data *drm_data;
+ struct drm_gem_object *obj = ptr;
+ enum drm_gem_object_status s = 0;
+ size_t add_size;
+
+ if (!obj)
+ return 0;
+
+ add_size = (obj->funcs && obj->funcs->rss) ?
+ obj->funcs->rss(obj) : obj->size;
+
+ if (obj->funcs && obj->funcs->status) {
+ s = obj->funcs->status(obj);
+ drm_data->supported_status |= s;
+ }
+
+ if (drm_gem_object_is_shared_for_memory_stats(obj))
+ drm_data->status.shared += obj->size;
+ else
+ drm_data->status.private += obj->size;
+
+ if (s & DRM_GEM_OBJECT_RESIDENT) {
+ drm_data->status.resident += add_size;
+ } else {
+ /* If already purged or not yet backed by pages, don't
+ * count it as purgeable:
+ */
+ s &= ~DRM_GEM_OBJECT_PURGEABLE;
+ }
+
+ if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
+ drm_data->status.active += add_size;
+ drm_data->supported_status |= DRM_GEM_OBJECT_ACTIVE;
+
+ /* If still active, don't count as purgeable: */
+ s &= ~DRM_GEM_OBJECT_PURGEABLE;
+ }
+
+ if (s & DRM_GEM_OBJECT_PURGEABLE)
+ drm_data->status.purgeable += add_size;
+
+ return 0;
+}
+
/**
* drm_show_memory_stats - Helper to collect and show standard fdinfo memory stats
* @p: the printer to print output to
@@ -902,50 +954,13 @@ EXPORT_SYMBOL(drm_print_memory_stats);
*/
void drm_show_memory_stats(struct drm_printer *p, struct drm_file *file)
{
- struct drm_gem_object *obj;
- struct drm_memory_stats status = {};
- enum drm_gem_object_status supported_status = 0;
- int id;
+ struct drm_bo_print_data data = {};
spin_lock(&file->table_lock);
- idr_for_each_entry (&file->object_idr, obj, id) {
- enum drm_gem_object_status s = 0;
- size_t add_size = (obj->funcs && obj->funcs->rss) ?
- obj->funcs->rss(obj) : obj->size;
-
- if (obj->funcs && obj->funcs->status) {
- s = obj->funcs->status(obj);
- supported_status |= s;
- }
-
- if (drm_gem_object_is_shared_for_memory_stats(obj))
- status.shared += obj->size;
- else
- status.private += obj->size;
-
- if (s & DRM_GEM_OBJECT_RESIDENT) {
- status.resident += add_size;
- } else {
- /* If already purged or not yet backed by pages, don't
- * count it as purgeable:
- */
- s &= ~DRM_GEM_OBJECT_PURGEABLE;
- }
-
- if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
- status.active += add_size;
- supported_status |= DRM_GEM_OBJECT_ACTIVE;
-
- /* If still active, don't count as purgeable: */
- s &= ~DRM_GEM_OBJECT_PURGEABLE;
- }
-
- if (s & DRM_GEM_OBJECT_PURGEABLE)
- status.purgeable += add_size;
- }
+ idr_for_each(&file->object_idr, &drm_bo_memory_stats, &data);
spin_unlock(&file->table_lock);
- drm_print_memory_stats(p, &status, supported_status, "memory");
+ drm_print_memory_stats(p, &data.status, data.supported_status, "memory");
}
EXPORT_SYMBOL(drm_show_memory_stats);
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()
2025-05-28 9:13 ` [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats() Simona Vetter
@ 2025-05-28 9:22 ` Simona Vetter
2025-05-28 20:10 ` kernel test robot
1 sibling, 0 replies; 10+ messages in thread
From: Simona Vetter @ 2025-05-28 9:22 UTC (permalink / raw)
To: DRI Development
Cc: intel-xe, Simona Vetter, Rob Clark, Emil Velikov, Tvrtko Ursulin,
stable, Simona Vetter
On Wed, May 28, 2025 at 11:13:00AM +0200, Simona Vetter wrote:
> Unlike idr_for_each_entry(), which terminates on the first NULL entry,
> idr_for_each passes them through. This fixes potential issues with the
> idr walk terminating prematurely due to transient NULL entries the
> exist when creating and destroying a handle.
>
> Note that transient NULL pointers in drm_file.object_idr have been a
> thing since f6cd7daecff5 ("drm: Release driver references to handle
> before making it available again"), this is a really old issue.
>
> Aside from temporarily inconsistent fdinfo statistic there's no other
> impact of this issue.
>
> Fixes: 686b21b5f6ca ("drm: Add fdinfo memory stats")
> Cc: Rob Clark <robdclark@chromium.org>
> Cc: Emil Velikov <emil.l.velikov@gmail.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: <stable@vger.kernel.org> # v6.5+
> Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
Ok I screwed up reading idr_for_each_entry() respectively
idr_get_next_ul() big time, it already copes with NULL entries entirely
fine.
Mea culpa.
-Sima
> ---
> drivers/gpu/drm/drm_file.c | 95 ++++++++++++++++++++++----------------
> 1 file changed, 55 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
> index 246cf845e2c9..428a4eb85e94 100644
> --- a/drivers/gpu/drm/drm_file.c
> +++ b/drivers/gpu/drm/drm_file.c
> @@ -892,6 +892,58 @@ void drm_print_memory_stats(struct drm_printer *p,
> }
> EXPORT_SYMBOL(drm_print_memory_stats);
>
> +struct drm_bo_print_data {
> + struct drm_memory_stats status;
> + enum drm_gem_object_status supported_status;
> +};
> +
> +static int
> +drm_bo_memory_stats(int id, void *ptr, void *data)
> +{
> + struct drm_bo_print_data *drm_data;
> + struct drm_gem_object *obj = ptr;
> + enum drm_gem_object_status s = 0;
> + size_t add_size;
> +
> + if (!obj)
> + return 0;
> +
> + add_size = (obj->funcs && obj->funcs->rss) ?
> + obj->funcs->rss(obj) : obj->size;
> +
> + if (obj->funcs && obj->funcs->status) {
> + s = obj->funcs->status(obj);
> + drm_data->supported_status |= s;
> + }
> +
> + if (drm_gem_object_is_shared_for_memory_stats(obj))
> + drm_data->status.shared += obj->size;
> + else
> + drm_data->status.private += obj->size;
> +
> + if (s & DRM_GEM_OBJECT_RESIDENT) {
> + drm_data->status.resident += add_size;
> + } else {
> + /* If already purged or not yet backed by pages, don't
> + * count it as purgeable:
> + */
> + s &= ~DRM_GEM_OBJECT_PURGEABLE;
> + }
> +
> + if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
> + drm_data->status.active += add_size;
> + drm_data->supported_status |= DRM_GEM_OBJECT_ACTIVE;
> +
> + /* If still active, don't count as purgeable: */
> + s &= ~DRM_GEM_OBJECT_PURGEABLE;
> + }
> +
> + if (s & DRM_GEM_OBJECT_PURGEABLE)
> + drm_data->status.purgeable += add_size;
> +
> + return 0;
> +}
> +
> /**
> * drm_show_memory_stats - Helper to collect and show standard fdinfo memory stats
> * @p: the printer to print output to
> @@ -902,50 +954,13 @@ EXPORT_SYMBOL(drm_print_memory_stats);
> */
> void drm_show_memory_stats(struct drm_printer *p, struct drm_file *file)
> {
> - struct drm_gem_object *obj;
> - struct drm_memory_stats status = {};
> - enum drm_gem_object_status supported_status = 0;
> - int id;
> + struct drm_bo_print_data data = {};
>
> spin_lock(&file->table_lock);
> - idr_for_each_entry (&file->object_idr, obj, id) {
> - enum drm_gem_object_status s = 0;
> - size_t add_size = (obj->funcs && obj->funcs->rss) ?
> - obj->funcs->rss(obj) : obj->size;
> -
> - if (obj->funcs && obj->funcs->status) {
> - s = obj->funcs->status(obj);
> - supported_status |= s;
> - }
> -
> - if (drm_gem_object_is_shared_for_memory_stats(obj))
> - status.shared += obj->size;
> - else
> - status.private += obj->size;
> -
> - if (s & DRM_GEM_OBJECT_RESIDENT) {
> - status.resident += add_size;
> - } else {
> - /* If already purged or not yet backed by pages, don't
> - * count it as purgeable:
> - */
> - s &= ~DRM_GEM_OBJECT_PURGEABLE;
> - }
> -
> - if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
> - status.active += add_size;
> - supported_status |= DRM_GEM_OBJECT_ACTIVE;
> -
> - /* If still active, don't count as purgeable: */
> - s &= ~DRM_GEM_OBJECT_PURGEABLE;
> - }
> -
> - if (s & DRM_GEM_OBJECT_PURGEABLE)
> - status.purgeable += add_size;
> - }
> + idr_for_each(&file->object_idr, &drm_bo_memory_stats, &data);
> spin_unlock(&file->table_lock);
>
> - drm_print_memory_stats(p, &status, supported_status, "memory");
> + drm_print_memory_stats(p, &data.status, data.supported_status, "memory");
> }
> EXPORT_SYMBOL(drm_show_memory_stats);
>
> --
> 2.49.0
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-05-28 9:12 ` [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail() Simona Vetter
@ 2025-05-28 9:26 ` Simona Vetter
2025-05-28 13:20 ` Jacek Lawrynowicz
2025-06-02 15:15 ` Thomas Zimmermann
2 siblings, 0 replies; 10+ messages in thread
From: Simona Vetter @ 2025-05-28 9:26 UTC (permalink / raw)
To: DRI Development
Cc: intel-xe, Simona Vetter, Jacek Lawrynowicz, stable,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Simona Vetter
On Wed, May 28, 2025 at 11:12:59AM +0200, Simona Vetter wrote:
> Object creation is a careful dance where we must guarantee that the
> object is fully constructed before it is visible to other threads, and
> GEM buffer objects are no difference.
>
> Final publishing happens by calling drm_gem_handle_create(). After
> that the only allowed thing to do is call drm_gem_object_put() because
> a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
> (which is trivial since we have a linear allocator) can already tear
> down the object again.
>
> Luckily most drivers get this right, the very few exceptions I've
> pinged the relevant maintainers for. Unfortunately we also need
> drm_gem_handle_create() when creating additional handles for an
> already existing object (e.g. GETFB ioctl or the various bo import
> ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
> the only exported function to stop these issues from happening.
>
> Now unfortunately the implementation of drm_gem_handle_create() isn't
> living up to standards: It does correctly finishe object
> initialization at the global level, and hence is safe against a
> concurrent tear down. But it also sets up the file-private aspects of
> the handle, and that part goes wrong: We fully register the object in
> the drm_file.object_idr before calling drm_vma_node_allow() or
> obj->funcs->open, which opens up races against concurrent removal of
> that handle in drm_gem_handle_delete().
>
> Fix this with the usual two-stage approach of first reserving the
> handle id, and then only registering the object after we've completed
> the file-private setup.
>
> Jacek reported this with a testcase of concurrently calling GEM_CLOSE
> on a freshly-created object (which also destroys the object), but it
> should be possible to hit this with just additional handles created
> through import or GETFB without completed destroying the underlying
> object with the concurrent GEM_CLOSE ioctl calls.
>
> Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
> Release driver references to handle before making it available
> again"), which means a cool 9 years have passed until someone noticed
> that we need to make this symmetry or there's still gaps left :-/
> Without the 2-stage close approach we'd still have a race, therefore
> that's an integral part of this bugfix.
>
> More importantly, this means we can have NULL pointers behind
> allocated id in our drm_file.object_idr. We need to check for that
> now:
>
> - drm_gem_handle_delete() checks for ERR_OR_NULL already
>
> - drm_gem.c:object_lookup() also chekcs for NULL
>
> - drm_gem_release() should never be called if there's another thread
> still existing that could call into an IOCTL that creates a new
> handle, so cannot race. For paranoia I added a NULL check to
> drm_gem_object_release_handle() though.
>
> - most drivers (etnaviv, i915, msm) are find because they use
> idr_find, which maps both ENOENT and NULL to NULL.
>
> - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
> pointers might exist due to drm_gem_handle_delete(). This needs a
> separate patch. This is because idr_for_each_entry terminates on the
> first NULL entry and so might not iterate over everything.
>
> - similar for amd in amdgpu_debugfs_gem_info_show() and
> amdgpu_gem_force_release(). The latter is really questionable though
> since it's a best effort hack and there's no way to close all the
> races. Needs separate patches.
>
> - xe is really broken because it not uses idr_for_each_entry() but
> also drops the drm_file.table_lock, which can wreak the idr iterator
> state if you're unlucky enough. Maybe another reason to look into
> the drm fdinfo memory stats instead of hand-rolling too much.
>
> - drm_show_memory_stats() is also broken since it uses
> idr_for_each_entry. But since that's a preexisting bug I'll follow
> up with a separate patch.
I've already reworded the commit message locally since I now think
idr_for_each_entry is entirely fine.
-Sima
>
> Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: stable@vger.kernel.org
> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_gem.c | 10 +++++++++-
> include/drm/drm_file.h | 3 +++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 1e659d2660f7..e4e20dda47b1 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
> struct drm_file *file_priv = data;
> struct drm_gem_object *obj = ptr;
>
> + if (WARN_ON(!data))
> + return 0;
> +
> if (obj->funcs->close)
> obj->funcs->close(obj, file_priv);
>
> @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> idr_preload(GFP_KERNEL);
> spin_lock(&file_priv->table_lock);
>
> - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
>
> spin_unlock(&file_priv->table_lock);
> idr_preload_end();
> @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> goto err_revoke;
> }
>
> + /* mirrors drm_gem_handle_delete to avoid races */
> + spin_lock(&file_priv->table_lock);
> + obj = idr_replace(&file_priv->object_idr, obj, handle);
> + WARN_ON(obj != NULL);
> + spin_unlock(&file_priv->table_lock);
> *handlep = handle;
> return 0;
>
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 5c3b2aa3e69d..d344d41e6cfe 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -300,6 +300,9 @@ struct drm_file {
> *
> * Mapping of mm object handles to object pointers. Used by the GEM
> * subsystem. Protected by @table_lock.
> + *
> + * Note that allocated entries might be NULL as a transient state when
> + * creating or deleting a handle.
> */
> struct idr object_idr;
>
> --
> 2.49.0
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-05-28 9:12 ` [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail() Simona Vetter
2025-05-28 9:26 ` Simona Vetter
@ 2025-05-28 13:20 ` Jacek Lawrynowicz
2025-06-02 15:15 ` Thomas Zimmermann
2 siblings, 0 replies; 10+ messages in thread
From: Jacek Lawrynowicz @ 2025-05-28 13:20 UTC (permalink / raw)
To: Simona Vetter, DRI Development
Cc: intel-xe, stable, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Simona Vetter
This fixes the race for me.
Tested-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
On 5/28/2025 11:12 AM, Simona Vetter wrote:
> Object creation is a careful dance where we must guarantee that the
> object is fully constructed before it is visible to other threads, and
> GEM buffer objects are no difference.
>
> Final publishing happens by calling drm_gem_handle_create(). After
> that the only allowed thing to do is call drm_gem_object_put() because
> a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
> (which is trivial since we have a linear allocator) can already tear
> down the object again.
>
> Luckily most drivers get this right, the very few exceptions I've
> pinged the relevant maintainers for. Unfortunately we also need
> drm_gem_handle_create() when creating additional handles for an
> already existing object (e.g. GETFB ioctl or the various bo import
> ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
> the only exported function to stop these issues from happening.
>
> Now unfortunately the implementation of drm_gem_handle_create() isn't
> living up to standards: It does correctly finishe object
> initialization at the global level, and hence is safe against a
> concurrent tear down. But it also sets up the file-private aspects of
> the handle, and that part goes wrong: We fully register the object in
> the drm_file.object_idr before calling drm_vma_node_allow() or
> obj->funcs->open, which opens up races against concurrent removal of
> that handle in drm_gem_handle_delete().
>
> Fix this with the usual two-stage approach of first reserving the
> handle id, and then only registering the object after we've completed
> the file-private setup.
>
> Jacek reported this with a testcase of concurrently calling GEM_CLOSE
> on a freshly-created object (which also destroys the object), but it
> should be possible to hit this with just additional handles created
> through import or GETFB without completed destroying the underlying
> object with the concurrent GEM_CLOSE ioctl calls.
>
> Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
> Release driver references to handle before making it available
> again"), which means a cool 9 years have passed until someone noticed
> that we need to make this symmetry or there's still gaps left :-/
> Without the 2-stage close approach we'd still have a race, therefore
> that's an integral part of this bugfix.
>
> More importantly, this means we can have NULL pointers behind
> allocated id in our drm_file.object_idr. We need to check for that
> now:
>
> - drm_gem_handle_delete() checks for ERR_OR_NULL already
>
> - drm_gem.c:object_lookup() also chekcs for NULL
>
> - drm_gem_release() should never be called if there's another thread
> still existing that could call into an IOCTL that creates a new
> handle, so cannot race. For paranoia I added a NULL check to
> drm_gem_object_release_handle() though.
>
> - most drivers (etnaviv, i915, msm) are find because they use
> idr_find, which maps both ENOENT and NULL to NULL.
>
> - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
> pointers might exist due to drm_gem_handle_delete(). This needs a
> separate patch. This is because idr_for_each_entry terminates on the
> first NULL entry and so might not iterate over everything.
>
> - similar for amd in amdgpu_debugfs_gem_info_show() and
> amdgpu_gem_force_release(). The latter is really questionable though
> since it's a best effort hack and there's no way to close all the
> races. Needs separate patches.
>
> - xe is really broken because it not uses idr_for_each_entry() but
> also drops the drm_file.table_lock, which can wreak the idr iterator
> state if you're unlucky enough. Maybe another reason to look into
> the drm fdinfo memory stats instead of hand-rolling too much.
>
> - drm_show_memory_stats() is also broken since it uses
> idr_for_each_entry. But since that's a preexisting bug I'll follow
> up with a separate patch.
>
> Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: stable@vger.kernel.org
> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_gem.c | 10 +++++++++-
> include/drm/drm_file.h | 3 +++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 1e659d2660f7..e4e20dda47b1 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
> struct drm_file *file_priv = data;
> struct drm_gem_object *obj = ptr;
>
> + if (WARN_ON(!data))
> + return 0;
> +
> if (obj->funcs->close)
> obj->funcs->close(obj, file_priv);
>
> @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> idr_preload(GFP_KERNEL);
> spin_lock(&file_priv->table_lock);
>
> - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
>
> spin_unlock(&file_priv->table_lock);
> idr_preload_end();
> @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> goto err_revoke;
> }
>
> + /* mirrors drm_gem_handle_delete to avoid races */
> + spin_lock(&file_priv->table_lock);
> + obj = idr_replace(&file_priv->object_idr, obj, handle);
> + WARN_ON(obj != NULL);
> + spin_unlock(&file_priv->table_lock);
> *handlep = handle;
> return 0;
>
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 5c3b2aa3e69d..d344d41e6cfe 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -300,6 +300,9 @@ struct drm_file {
> *
> * Mapping of mm object handles to object pointers. Used by the GEM
> * subsystem. Protected by @table_lock.
> + *
> + * Note that allocated entries might be NULL as a transient state when
> + * creating or deleting a handle.
> */
> struct idr object_idr;
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()
2025-05-28 9:13 ` [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats() Simona Vetter
2025-05-28 9:22 ` Simona Vetter
@ 2025-05-28 20:10 ` kernel test robot
1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2025-05-28 20:10 UTC (permalink / raw)
To: Simona Vetter, DRI Development
Cc: llvm, oe-kbuild-all, intel-xe, Simona Vetter, Rob Clark,
Emil Velikov, Tvrtko Ursulin, stable
Hi Simona,
kernel test robot noticed the following build warnings:
[auto build test WARNING on next-20250527]
[also build test WARNING on linus/master v6.15]
[cannot apply to v6.15 v6.15-rc7 v6.15-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Simona-Vetter/drm-gem-Fix-race-in-drm_gem_handle_create_tail/20250528-171524
base: next-20250527
patch link: https://lore.kernel.org/r/20250528091307.1894940-3-simona.vetter%40ffwll.ch
patch subject: [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()
config: riscv-randconfig-001-20250529 (https://download.01.org/0day-ci/archive/20250529/202505290334.GjoY9qsk-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250529/202505290334.GjoY9qsk-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505290334.GjoY9qsk-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/drm_file.c:916:3: warning: variable 'drm_data' is uninitialized when used here [-Wuninitialized]
916 | drm_data->supported_status |= s;
| ^~~~~~~~
drivers/gpu/drm/drm_file.c:903:36: note: initialize the variable 'drm_data' to silence this warning
903 | struct drm_bo_print_data *drm_data;
| ^
| = NULL
1 warning generated.
vim +/drm_data +916 drivers/gpu/drm/drm_file.c
899
900 static int
901 drm_bo_memory_stats(int id, void *ptr, void *data)
902 {
903 struct drm_bo_print_data *drm_data;
904 struct drm_gem_object *obj = ptr;
905 enum drm_gem_object_status s = 0;
906 size_t add_size;
907
908 if (!obj)
909 return 0;
910
911 add_size = (obj->funcs && obj->funcs->rss) ?
912 obj->funcs->rss(obj) : obj->size;
913
914 if (obj->funcs && obj->funcs->status) {
915 s = obj->funcs->status(obj);
> 916 drm_data->supported_status |= s;
917 }
918
919 if (drm_gem_object_is_shared_for_memory_stats(obj))
920 drm_data->status.shared += obj->size;
921 else
922 drm_data->status.private += obj->size;
923
924 if (s & DRM_GEM_OBJECT_RESIDENT) {
925 drm_data->status.resident += add_size;
926 } else {
927 /* If already purged or not yet backed by pages, don't
928 * count it as purgeable:
929 */
930 s &= ~DRM_GEM_OBJECT_PURGEABLE;
931 }
932
933 if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
934 drm_data->status.active += add_size;
935 drm_data->supported_status |= DRM_GEM_OBJECT_ACTIVE;
936
937 /* If still active, don't count as purgeable: */
938 s &= ~DRM_GEM_OBJECT_PURGEABLE;
939 }
940
941 if (s & DRM_GEM_OBJECT_PURGEABLE)
942 drm_data->status.purgeable += add_size;
943
944 return 0;
945 }
946
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-05-28 9:12 ` [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail() Simona Vetter
2025-05-28 9:26 ` Simona Vetter
2025-05-28 13:20 ` Jacek Lawrynowicz
@ 2025-06-02 15:15 ` Thomas Zimmermann
2025-06-03 11:45 ` Simona Vetter
2 siblings, 1 reply; 10+ messages in thread
From: Thomas Zimmermann @ 2025-06-02 15:15 UTC (permalink / raw)
To: Simona Vetter, DRI Development
Cc: intel-xe, Jacek Lawrynowicz, stable, Maarten Lankhorst,
Maxime Ripard, David Airlie, Simona Vetter, Simona Vetter
Hi
Am 28.05.25 um 11:12 schrieb Simona Vetter:
> Object creation is a careful dance where we must guarantee that the
> object is fully constructed before it is visible to other threads, and
> GEM buffer objects are no difference.
>
> Final publishing happens by calling drm_gem_handle_create(). After
> that the only allowed thing to do is call drm_gem_object_put() because
> a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
> (which is trivial since we have a linear allocator) can already tear
> down the object again.
>
> Luckily most drivers get this right, the very few exceptions I've
> pinged the relevant maintainers for. Unfortunately we also need
> drm_gem_handle_create() when creating additional handles for an
> already existing object (e.g. GETFB ioctl or the various bo import
> ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
> the only exported function to stop these issues from happening.
>
> Now unfortunately the implementation of drm_gem_handle_create() isn't
> living up to standards: It does correctly finishe object
> initialization at the global level, and hence is safe against a
> concurrent tear down. But it also sets up the file-private aspects of
> the handle, and that part goes wrong: We fully register the object in
> the drm_file.object_idr before calling drm_vma_node_allow() or
> obj->funcs->open, which opens up races against concurrent removal of
> that handle in drm_gem_handle_delete().
>
> Fix this with the usual two-stage approach of first reserving the
> handle id, and then only registering the object after we've completed
> the file-private setup.
>
> Jacek reported this with a testcase of concurrently calling GEM_CLOSE
> on a freshly-created object (which also destroys the object), but it
> should be possible to hit this with just additional handles created
> through import or GETFB without completed destroying the underlying
> object with the concurrent GEM_CLOSE ioctl calls.
>
> Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
> Release driver references to handle before making it available
> again"), which means a cool 9 years have passed until someone noticed
> that we need to make this symmetry or there's still gaps left :-/
> Without the 2-stage close approach we'd still have a race, therefore
> that's an integral part of this bugfix.
>
> More importantly, this means we can have NULL pointers behind
> allocated id in our drm_file.object_idr. We need to check for that
> now:
>
> - drm_gem_handle_delete() checks for ERR_OR_NULL already
>
> - drm_gem.c:object_lookup() also chekcs for NULL
>
> - drm_gem_release() should never be called if there's another thread
> still existing that could call into an IOCTL that creates a new
> handle, so cannot race. For paranoia I added a NULL check to
> drm_gem_object_release_handle() though.
>
> - most drivers (etnaviv, i915, msm) are find because they use
> idr_find, which maps both ENOENT and NULL to NULL.
>
> - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
> pointers might exist due to drm_gem_handle_delete(). This needs a
> separate patch. This is because idr_for_each_entry terminates on the
> first NULL entry and so might not iterate over everything.
>
> - similar for amd in amdgpu_debugfs_gem_info_show() and
> amdgpu_gem_force_release(). The latter is really questionable though
> since it's a best effort hack and there's no way to close all the
> races. Needs separate patches.
>
> - xe is really broken because it not uses idr_for_each_entry() but
> also drops the drm_file.table_lock, which can wreak the idr iterator
> state if you're unlucky enough. Maybe another reason to look into
> the drm fdinfo memory stats instead of hand-rolling too much.
>
> - drm_show_memory_stats() is also broken since it uses
> idr_for_each_entry. But since that's a preexisting bug I'll follow
> up with a separate patch.
>
> Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: stable@vger.kernel.org
> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_gem.c | 10 +++++++++-
> include/drm/drm_file.h | 3 +++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 1e659d2660f7..e4e20dda47b1 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
> struct drm_file *file_priv = data;
> struct drm_gem_object *obj = ptr;
>
> + if (WARN_ON(!data))
> + return 0;
> +
> if (obj->funcs->close)
> obj->funcs->close(obj, file_priv);
>
> @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> idr_preload(GFP_KERNEL);
> spin_lock(&file_priv->table_lock);
>
> - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
>
> spin_unlock(&file_priv->table_lock);
> idr_preload_end();
> @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> goto err_revoke;
> }
>
> + /* mirrors drm_gem_handle_delete to avoid races */
> + spin_lock(&file_priv->table_lock);
> + obj = idr_replace(&file_priv->object_idr, obj, handle);
> + WARN_ON(obj != NULL);
A DRM print function would be preferable. The obj here is an errno
pointer. Should the errno code be part of the error message?
If it fails, why does the function still succeed?
Best regards
Thomas
> + spin_unlock(&file_priv->table_lock);
> *handlep = handle;
> return 0;
>
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 5c3b2aa3e69d..d344d41e6cfe 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -300,6 +300,9 @@ struct drm_file {
> *
> * Mapping of mm object handles to object pointers. Used by the GEM
> * subsystem. Protected by @table_lock.
> + *
> + * Note that allocated entries might be NULL as a transient state when
> + * creating or deleting a handle.
> */
> struct idr object_idr;
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-06-02 15:15 ` Thomas Zimmermann
@ 2025-06-03 11:45 ` Simona Vetter
2025-06-03 12:40 ` Thomas Zimmermann
2025-06-04 9:02 ` Simona Vetter
0 siblings, 2 replies; 10+ messages in thread
From: Simona Vetter @ 2025-06-03 11:45 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Simona Vetter, DRI Development, intel-xe, Jacek Lawrynowicz,
stable, Maarten Lankhorst, Maxime Ripard, David Airlie,
Simona Vetter, Simona Vetter
On Mon, Jun 02, 2025 at 05:15:58PM +0200, Thomas Zimmermann wrote:
> Hi
>
> Am 28.05.25 um 11:12 schrieb Simona Vetter:
> > Object creation is a careful dance where we must guarantee that the
> > object is fully constructed before it is visible to other threads, and
> > GEM buffer objects are no difference.
> >
> > Final publishing happens by calling drm_gem_handle_create(). After
> > that the only allowed thing to do is call drm_gem_object_put() because
> > a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
> > (which is trivial since we have a linear allocator) can already tear
> > down the object again.
> >
> > Luckily most drivers get this right, the very few exceptions I've
> > pinged the relevant maintainers for. Unfortunately we also need
> > drm_gem_handle_create() when creating additional handles for an
> > already existing object (e.g. GETFB ioctl or the various bo import
> > ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
> > the only exported function to stop these issues from happening.
> >
> > Now unfortunately the implementation of drm_gem_handle_create() isn't
> > living up to standards: It does correctly finishe object
> > initialization at the global level, and hence is safe against a
> > concurrent tear down. But it also sets up the file-private aspects of
> > the handle, and that part goes wrong: We fully register the object in
> > the drm_file.object_idr before calling drm_vma_node_allow() or
> > obj->funcs->open, which opens up races against concurrent removal of
> > that handle in drm_gem_handle_delete().
> >
> > Fix this with the usual two-stage approach of first reserving the
> > handle id, and then only registering the object after we've completed
> > the file-private setup.
> >
> > Jacek reported this with a testcase of concurrently calling GEM_CLOSE
> > on a freshly-created object (which also destroys the object), but it
> > should be possible to hit this with just additional handles created
> > through import or GETFB without completed destroying the underlying
> > object with the concurrent GEM_CLOSE ioctl calls.
> >
> > Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
> > Release driver references to handle before making it available
> > again"), which means a cool 9 years have passed until someone noticed
> > that we need to make this symmetry or there's still gaps left :-/
> > Without the 2-stage close approach we'd still have a race, therefore
> > that's an integral part of this bugfix.
> >
> > More importantly, this means we can have NULL pointers behind
> > allocated id in our drm_file.object_idr. We need to check for that
> > now:
> >
> > - drm_gem_handle_delete() checks for ERR_OR_NULL already
> >
> > - drm_gem.c:object_lookup() also chekcs for NULL
> >
> > - drm_gem_release() should never be called if there's another thread
> > still existing that could call into an IOCTL that creates a new
> > handle, so cannot race. For paranoia I added a NULL check to
> > drm_gem_object_release_handle() though.
> >
> > - most drivers (etnaviv, i915, msm) are find because they use
> > idr_find, which maps both ENOENT and NULL to NULL.
> >
> > - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
> > pointers might exist due to drm_gem_handle_delete(). This needs a
> > separate patch. This is because idr_for_each_entry terminates on the
> > first NULL entry and so might not iterate over everything.
> >
> > - similar for amd in amdgpu_debugfs_gem_info_show() and
> > amdgpu_gem_force_release(). The latter is really questionable though
> > since it's a best effort hack and there's no way to close all the
> > races. Needs separate patches.
> >
> > - xe is really broken because it not uses idr_for_each_entry() but
> > also drops the drm_file.table_lock, which can wreak the idr iterator
> > state if you're unlucky enough. Maybe another reason to look into
> > the drm fdinfo memory stats instead of hand-rolling too much.
> >
> > - drm_show_memory_stats() is also broken since it uses
> > idr_for_each_entry. But since that's a preexisting bug I'll follow
> > up with a separate patch.
> >
> > Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> > Cc: stable@vger.kernel.org
> > Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: David Airlie <airlied@gmail.com>
> > Cc: Simona Vetter <simona@ffwll.ch>
> > Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> > Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
> > ---
> > drivers/gpu/drm/drm_gem.c | 10 +++++++++-
> > include/drm/drm_file.h | 3 +++
> > 2 files changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index 1e659d2660f7..e4e20dda47b1 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
> > struct drm_file *file_priv = data;
> > struct drm_gem_object *obj = ptr;
> > + if (WARN_ON(!data))
> > + return 0;
> > +
> > if (obj->funcs->close)
> > obj->funcs->close(obj, file_priv);
> > @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> > idr_preload(GFP_KERNEL);
> > spin_lock(&file_priv->table_lock);
> > - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> > + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
> > spin_unlock(&file_priv->table_lock);
> > idr_preload_end();
> > @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> > goto err_revoke;
> > }
> > + /* mirrors drm_gem_handle_delete to avoid races */
> > + spin_lock(&file_priv->table_lock);
> > + obj = idr_replace(&file_priv->object_idr, obj, handle);
> > + WARN_ON(obj != NULL);
>
> A DRM print function would be preferable. The obj here is an errno pointer.
> Should the errno code be part of the error message?
>
> If it fails, why does the function still succeed?
This is an internal error that should never happen, at that point just
bailing out is the way to go.
Also note that the error code here is just to satisfy the function
signature that id_for_each expects, we don't look at it ever (since if
there's no bugs, it should never fail). I learned this because I actually
removed the int return value and stuff didn't compile :-)
I can use drm_WARN_ON if you want me to though?
I'll also explain this in the commit message for the next round.
-Sima
>
> Best regards
> Thomas
>
> > + spin_unlock(&file_priv->table_lock);
> > *handlep = handle;
> > return 0;
> > diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> > index 5c3b2aa3e69d..d344d41e6cfe 100644
> > --- a/include/drm/drm_file.h
> > +++ b/include/drm/drm_file.h
> > @@ -300,6 +300,9 @@ struct drm_file {
> > *
> > * Mapping of mm object handles to object pointers. Used by the GEM
> > * subsystem. Protected by @table_lock.
> > + *
> > + * Note that allocated entries might be NULL as a transient state when
> > + * creating or deleting a handle.
> > */
> > struct idr object_idr;
>
> --
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Frankenstrasse 146, 90461 Nuernberg, Germany
> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
> HRB 36809 (AG Nuernberg)
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-06-03 11:45 ` Simona Vetter
@ 2025-06-03 12:40 ` Thomas Zimmermann
2025-06-04 9:02 ` Simona Vetter
1 sibling, 0 replies; 10+ messages in thread
From: Thomas Zimmermann @ 2025-06-03 12:40 UTC (permalink / raw)
To: Simona Vetter
Cc: DRI Development, intel-xe, Jacek Lawrynowicz, stable,
Maarten Lankhorst, Maxime Ripard, David Airlie, Simona Vetter,
Simona Vetter
Hi
Am 03.06.25 um 13:45 schrieb Simona Vetter:
> On Mon, Jun 02, 2025 at 05:15:58PM +0200, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 28.05.25 um 11:12 schrieb Simona Vetter:
>>> Object creation is a careful dance where we must guarantee that the
>>> object is fully constructed before it is visible to other threads, and
>>> GEM buffer objects are no difference.
>>>
>>> Final publishing happens by calling drm_gem_handle_create(). After
>>> that the only allowed thing to do is call drm_gem_object_put() because
>>> a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
>>> (which is trivial since we have a linear allocator) can already tear
>>> down the object again.
>>>
>>> Luckily most drivers get this right, the very few exceptions I've
>>> pinged the relevant maintainers for. Unfortunately we also need
>>> drm_gem_handle_create() when creating additional handles for an
>>> already existing object (e.g. GETFB ioctl or the various bo import
>>> ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
>>> the only exported function to stop these issues from happening.
>>>
>>> Now unfortunately the implementation of drm_gem_handle_create() isn't
>>> living up to standards: It does correctly finishe object
>>> initialization at the global level, and hence is safe against a
>>> concurrent tear down. But it also sets up the file-private aspects of
>>> the handle, and that part goes wrong: We fully register the object in
>>> the drm_file.object_idr before calling drm_vma_node_allow() or
>>> obj->funcs->open, which opens up races against concurrent removal of
>>> that handle in drm_gem_handle_delete().
>>>
>>> Fix this with the usual two-stage approach of first reserving the
>>> handle id, and then only registering the object after we've completed
>>> the file-private setup.
>>>
>>> Jacek reported this with a testcase of concurrently calling GEM_CLOSE
>>> on a freshly-created object (which also destroys the object), but it
>>> should be possible to hit this with just additional handles created
>>> through import or GETFB without completed destroying the underlying
>>> object with the concurrent GEM_CLOSE ioctl calls.
>>>
>>> Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
>>> Release driver references to handle before making it available
>>> again"), which means a cool 9 years have passed until someone noticed
>>> that we need to make this symmetry or there's still gaps left :-/
>>> Without the 2-stage close approach we'd still have a race, therefore
>>> that's an integral part of this bugfix.
>>>
>>> More importantly, this means we can have NULL pointers behind
>>> allocated id in our drm_file.object_idr. We need to check for that
>>> now:
>>>
>>> - drm_gem_handle_delete() checks for ERR_OR_NULL already
>>>
>>> - drm_gem.c:object_lookup() also chekcs for NULL
>>>
>>> - drm_gem_release() should never be called if there's another thread
>>> still existing that could call into an IOCTL that creates a new
>>> handle, so cannot race. For paranoia I added a NULL check to
>>> drm_gem_object_release_handle() though.
>>>
>>> - most drivers (etnaviv, i915, msm) are find because they use
>>> idr_find, which maps both ENOENT and NULL to NULL.
>>>
>>> - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
>>> pointers might exist due to drm_gem_handle_delete(). This needs a
>>> separate patch. This is because idr_for_each_entry terminates on the
>>> first NULL entry and so might not iterate over everything.
>>>
>>> - similar for amd in amdgpu_debugfs_gem_info_show() and
>>> amdgpu_gem_force_release(). The latter is really questionable though
>>> since it's a best effort hack and there's no way to close all the
>>> races. Needs separate patches.
>>>
>>> - xe is really broken because it not uses idr_for_each_entry() but
>>> also drops the drm_file.table_lock, which can wreak the idr iterator
>>> state if you're unlucky enough. Maybe another reason to look into
>>> the drm fdinfo memory stats instead of hand-rolling too much.
>>>
>>> - drm_show_memory_stats() is also broken since it uses
>>> idr_for_each_entry. But since that's a preexisting bug I'll follow
>>> up with a separate patch.
>>>
>>> Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
>>> Cc: stable@vger.kernel.org
>>> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>> Cc: Maxime Ripard <mripard@kernel.org>
>>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>>> Cc: David Airlie <airlied@gmail.com>
>>> Cc: Simona Vetter <simona@ffwll.ch>
>>> Signed-off-by: Simona Vetter <simona.vetter@intel.com>
>>> Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
>>> ---
>>> drivers/gpu/drm/drm_gem.c | 10 +++++++++-
>>> include/drm/drm_file.h | 3 +++
>>> 2 files changed, 12 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
>>> index 1e659d2660f7..e4e20dda47b1 100644
>>> --- a/drivers/gpu/drm/drm_gem.c
>>> +++ b/drivers/gpu/drm/drm_gem.c
>>> @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
>>> struct drm_file *file_priv = data;
>>> struct drm_gem_object *obj = ptr;
>>> + if (WARN_ON(!data))
>>> + return 0;
>>> +
>>> if (obj->funcs->close)
>>> obj->funcs->close(obj, file_priv);
>>> @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
>>> idr_preload(GFP_KERNEL);
>>> spin_lock(&file_priv->table_lock);
>>> - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
>>> + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
>>> spin_unlock(&file_priv->table_lock);
>>> idr_preload_end();
>>> @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
>>> goto err_revoke;
>>> }
>>> + /* mirrors drm_gem_handle_delete to avoid races */
>>> + spin_lock(&file_priv->table_lock);
>>> + obj = idr_replace(&file_priv->object_idr, obj, handle);
>>> + WARN_ON(obj != NULL);
>> A DRM print function would be preferable. The obj here is an errno pointer.
>> Should the errno code be part of the error message?
>>
>> If it fails, why does the function still succeed?
> This is an internal error that should never happen, at that point just
> bailing out is the way to go.
>
> Also note that the error code here is just to satisfy the function
> signature that id_for_each expects, we don't look at it ever (since if
> there's no bugs, it should never fail). I learned this because I actually
> removed the int return value and stuff didn't compile :-)
I see.
>
> I can use drm_WARN_ON if you want me to though?
If you use drm_WARN_ON, you can add
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Best regards
Thomas
>
> I'll also explain this in the commit message for the next round.
> -Sima
>
>> Best regards
>> Thomas
>>
>>> + spin_unlock(&file_priv->table_lock);
>>> *handlep = handle;
>>> return 0;
>>> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
>>> index 5c3b2aa3e69d..d344d41e6cfe 100644
>>> --- a/include/drm/drm_file.h
>>> +++ b/include/drm/drm_file.h
>>> @@ -300,6 +300,9 @@ struct drm_file {
>>> *
>>> * Mapping of mm object handles to object pointers. Used by the GEM
>>> * subsystem. Protected by @table_lock.
>>> + *
>>> + * Note that allocated entries might be NULL as a transient state when
>>> + * creating or deleting a handle.
>>> */
>>> struct idr object_idr;
>> --
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Frankenstrasse 146, 90461 Nuernberg, Germany
>> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
>> HRB 36809 (AG Nuernberg)
>>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail()
2025-06-03 11:45 ` Simona Vetter
2025-06-03 12:40 ` Thomas Zimmermann
@ 2025-06-04 9:02 ` Simona Vetter
1 sibling, 0 replies; 10+ messages in thread
From: Simona Vetter @ 2025-06-04 9:02 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Simona Vetter, DRI Development, intel-xe, Jacek Lawrynowicz,
stable, Maarten Lankhorst, Maxime Ripard, David Airlie,
Simona Vetter, Simona Vetter
On Tue, Jun 03, 2025 at 01:45:54PM +0200, Simona Vetter wrote:
> On Mon, Jun 02, 2025 at 05:15:58PM +0200, Thomas Zimmermann wrote:
> > Hi
> >
> > Am 28.05.25 um 11:12 schrieb Simona Vetter:
> > > Object creation is a careful dance where we must guarantee that the
> > > object is fully constructed before it is visible to other threads, and
> > > GEM buffer objects are no difference.
> > >
> > > Final publishing happens by calling drm_gem_handle_create(). After
> > > that the only allowed thing to do is call drm_gem_object_put() because
> > > a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
> > > (which is trivial since we have a linear allocator) can already tear
> > > down the object again.
> > >
> > > Luckily most drivers get this right, the very few exceptions I've
> > > pinged the relevant maintainers for. Unfortunately we also need
> > > drm_gem_handle_create() when creating additional handles for an
> > > already existing object (e.g. GETFB ioctl or the various bo import
> > > ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
> > > the only exported function to stop these issues from happening.
> > >
> > > Now unfortunately the implementation of drm_gem_handle_create() isn't
> > > living up to standards: It does correctly finishe object
> > > initialization at the global level, and hence is safe against a
> > > concurrent tear down. But it also sets up the file-private aspects of
> > > the handle, and that part goes wrong: We fully register the object in
> > > the drm_file.object_idr before calling drm_vma_node_allow() or
> > > obj->funcs->open, which opens up races against concurrent removal of
> > > that handle in drm_gem_handle_delete().
> > >
> > > Fix this with the usual two-stage approach of first reserving the
> > > handle id, and then only registering the object after we've completed
> > > the file-private setup.
> > >
> > > Jacek reported this with a testcase of concurrently calling GEM_CLOSE
> > > on a freshly-created object (which also destroys the object), but it
> > > should be possible to hit this with just additional handles created
> > > through import or GETFB without completed destroying the underlying
> > > object with the concurrent GEM_CLOSE ioctl calls.
> > >
> > > Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
> > > Release driver references to handle before making it available
> > > again"), which means a cool 9 years have passed until someone noticed
> > > that we need to make this symmetry or there's still gaps left :-/
> > > Without the 2-stage close approach we'd still have a race, therefore
> > > that's an integral part of this bugfix.
> > >
> > > More importantly, this means we can have NULL pointers behind
> > > allocated id in our drm_file.object_idr. We need to check for that
> > > now:
> > >
> > > - drm_gem_handle_delete() checks for ERR_OR_NULL already
> > >
> > > - drm_gem.c:object_lookup() also chekcs for NULL
> > >
> > > - drm_gem_release() should never be called if there's another thread
> > > still existing that could call into an IOCTL that creates a new
> > > handle, so cannot race. For paranoia I added a NULL check to
> > > drm_gem_object_release_handle() though.
> > >
> > > - most drivers (etnaviv, i915, msm) are find because they use
> > > idr_find, which maps both ENOENT and NULL to NULL.
> > >
> > > - vmgfx is already broken vmw_debugfs_gem_info_show() because NULL
> > > pointers might exist due to drm_gem_handle_delete(). This needs a
> > > separate patch. This is because idr_for_each_entry terminates on the
> > > first NULL entry and so might not iterate over everything.
> > >
> > > - similar for amd in amdgpu_debugfs_gem_info_show() and
> > > amdgpu_gem_force_release(). The latter is really questionable though
> > > since it's a best effort hack and there's no way to close all the
> > > races. Needs separate patches.
> > >
> > > - xe is really broken because it not uses idr_for_each_entry() but
> > > also drops the drm_file.table_lock, which can wreak the idr iterator
> > > state if you're unlucky enough. Maybe another reason to look into
> > > the drm fdinfo memory stats instead of hand-rolling too much.
> > >
> > > - drm_show_memory_stats() is also broken since it uses
> > > idr_for_each_entry. But since that's a preexisting bug I'll follow
> > > up with a separate patch.
> > >
> > > Reported-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> > > Cc: stable@vger.kernel.org
> > > Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Cc: Maxime Ripard <mripard@kernel.org>
> > > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > > Cc: David Airlie <airlied@gmail.com>
> > > Cc: Simona Vetter <simona@ffwll.ch>
> > > Signed-off-by: Simona Vetter <simona.vetter@intel.com>
> > > Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
> > > ---
> > > drivers/gpu/drm/drm_gem.c | 10 +++++++++-
> > > include/drm/drm_file.h | 3 +++
> > > 2 files changed, 12 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > > index 1e659d2660f7..e4e20dda47b1 100644
> > > --- a/drivers/gpu/drm/drm_gem.c
> > > +++ b/drivers/gpu/drm/drm_gem.c
> > > @@ -279,6 +279,9 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
> > > struct drm_file *file_priv = data;
> > > struct drm_gem_object *obj = ptr;
> > > + if (WARN_ON(!data))
> > > + return 0;
> > > +
> > > if (obj->funcs->close)
> > > obj->funcs->close(obj, file_priv);
> > > @@ -399,7 +402,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> > > idr_preload(GFP_KERNEL);
> > > spin_lock(&file_priv->table_lock);
> > > - ret = idr_alloc(&file_priv->object_idr, obj, 1, 0, GFP_NOWAIT);
> > > + ret = idr_alloc(&file_priv->object_idr, NULL, 1, 0, GFP_NOWAIT);
> > > spin_unlock(&file_priv->table_lock);
> > > idr_preload_end();
> > > @@ -420,6 +423,11 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
> > > goto err_revoke;
> > > }
> > > + /* mirrors drm_gem_handle_delete to avoid races */
> > > + spin_lock(&file_priv->table_lock);
> > > + obj = idr_replace(&file_priv->object_idr, obj, handle);
> > > + WARN_ON(obj != NULL);
> >
> > A DRM print function would be preferable. The obj here is an errno pointer.
> > Should the errno code be part of the error message?
> >
> > If it fails, why does the function still succeed?
>
> This is an internal error that should never happen, at that point just
> bailing out is the way to go.
>
> Also note that the error code here is just to satisfy the function
> signature that id_for_each expects, we don't look at it ever (since if
> there's no bugs, it should never fail). I learned this because I actually
> removed the int return value and stuff didn't compile :-)
Ok this part was nonsense, I mixed it up with handle_delete(). I still
don't think we should return an error code here, because we've
successfully installed the handle. It's just that something happened with
the idr that should be impossible, so all bets are off.
-Sima
> I can use drm_WARN_ON if you want me to though?
>
> I'll also explain this in the commit message for the next round.
> -Sima
>
> >
> > Best regards
> > Thomas
> >
> > > + spin_unlock(&file_priv->table_lock);
> > > *handlep = handle;
> > > return 0;
> > > diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> > > index 5c3b2aa3e69d..d344d41e6cfe 100644
> > > --- a/include/drm/drm_file.h
> > > +++ b/include/drm/drm_file.h
> > > @@ -300,6 +300,9 @@ struct drm_file {
> > > *
> > > * Mapping of mm object handles to object pointers. Used by the GEM
> > > * subsystem. Protected by @table_lock.
> > > + *
> > > + * Note that allocated entries might be NULL as a transient state when
> > > + * creating or deleting a handle.
> > > */
> > > struct idr object_idr;
> >
> > --
> > --
> > Thomas Zimmermann
> > Graphics Driver Developer
> > SUSE Software Solutions Germany GmbH
> > Frankenstrasse 146, 90461 Nuernberg, Germany
> > GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
> > HRB 36809 (AG Nuernberg)
> >
>
> --
> Simona Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-06-04 9:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250528091307.1894940-1-simona.vetter@ffwll.ch>
2025-05-28 9:12 ` [PATCH 1/8] drm/gem: Fix race in drm_gem_handle_create_tail() Simona Vetter
2025-05-28 9:26 ` Simona Vetter
2025-05-28 13:20 ` Jacek Lawrynowicz
2025-06-02 15:15 ` Thomas Zimmermann
2025-06-03 11:45 ` Simona Vetter
2025-06-03 12:40 ` Thomas Zimmermann
2025-06-04 9:02 ` Simona Vetter
2025-05-28 9:13 ` [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats() Simona Vetter
2025-05-28 9:22 ` Simona Vetter
2025-05-28 20:10 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox