Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH v2 0/3] drm/drm_exec, drm/tests: Fix / WA for uaf and lock alloc tracking
@ 2023-09-06  9:50 Thomas Hellström
  2023-09-06  9:50 ` [Intel-xe] [PATCH v2 1/3] drm/tests: helpers: Avoid a driver uaf Thomas Hellström
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Thomas Hellström @ 2023-09-06  9:50 UTC (permalink / raw)
  To: intel-xe, dri-devel
  Cc: Boris Brezillon, Danilo Krummrich, Christian König

While trying to replicate a weird drm_exec lock alloc tracking warning
using the drm_exec kunit test, the warning was shadowed by a UAF warning
from KASAN due to a bug in the drm kunit helpers.

Patch 1 fixes that drm kunit UAF.
Patch 2 introduces a drm_exec kunit subtest that shows the weird lock
alloc tracking warning if CONFIG_DEBUG_LOCK_ALLOC is set.
Patch 3 modifies drm_exec to avoid that lock alloc tracking warning. Although
the proper fix would probably be to modify lockdep to track the lock held
status differently, this workaround pushes the problem out of drm_exec,
so that any drm_exec users relying on its refcounting don't run into this.

v2:
- Rewording of commit messages
- Fix a typo (Danilo Krummrich)
- Add some commit message tags

Cc: Christian König <christian.koenig@amd.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: dri-devel@lists.freedesktop.org

Thomas Hellström (3):
  drm/tests: helpers: Avoid a driver uaf
  drm/tests/drm_exec: Add a test for object freeing within
    drm_exec_fini()
  drm/drm_exec: Work around a WW mutex lockdep oddity

 drivers/gpu/drm/drm_exec.c            |  2 +-
 drivers/gpu/drm/tests/drm_exec_test.c | 47 +++++++++++++++++++++++++++
 include/drm/drm_exec.h                | 35 +++++++++++++++++---
 include/drm/drm_kunit_helpers.h       |  4 ++-
 4 files changed, 82 insertions(+), 6 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-07 19:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06  9:50 [Intel-xe] [PATCH v2 0/3] drm/drm_exec, drm/tests: Fix / WA for uaf and lock alloc tracking Thomas Hellström
2023-09-06  9:50 ` [Intel-xe] [PATCH v2 1/3] drm/tests: helpers: Avoid a driver uaf Thomas Hellström
2023-09-06  9:50 ` [Intel-xe] [PATCH v2 2/3] drm/tests/drm_exec: Add a test for object freeing within drm_exec_fini() Thomas Hellström
2023-09-06  9:50 ` [Intel-xe] [PATCH v2 3/3] drm/drm_exec: Work around a WW mutex lockdep oddity Thomas Hellström
2023-09-06 10:48 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/drm_exec, drm/tests: Fix / WA for uaf and lock alloc tracking Patchwork
2023-09-06 10:48 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-06 10:50 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-06 10:57 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-06 10:57 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-09-06 10:58 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
2023-09-07 19:19 ` [Intel-xe] ✗ CI.Patch_applied: failure for drm/drm_exec, drm/tests: Fix / WA for uaf and lock alloc tracking (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox