public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix a couble of bugs in drm_kunit_helpers.c
@ 2023-09-20  6:11 Arthur Grillo
  2023-09-20  6:11 ` [PATCH 1/3] drm/tests: Fix kunit_release_action ctx argument Arthur Grillo
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Arthur Grillo @ 2023-09-20  6:11 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Maxime Ripard,
	Javier Martinez Canillas, Brendan Higgins, David Gow
  Cc: tales.aparecida, andrealmeid, mairacanal, dri-devel, linux-kernel,
	kunit-dev, Arthur Grillo

This patchset started when I found a use-after-free error reported by
KASAN while running some tests that did some mocking. When trying to fix
the initial problem, I found another noon-related one.

The second bug is just a wrong argument passed to a kunit_release_action
call. Patch #1 solves that.

Patches #2 and #3 solve the use-after-free bug. This error was a bit
trickier to find. Basically, the usual order in which the kunit_actions
run is the culprit, so #2 creates a helper function to reorder actions,
and #3 uses that helper.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
Arthur Grillo (3):
      drm/tests: Fix kunit_release_action ctx argument
      kunit: Add kunit_move_action_to_top_or_reset() to reorder actions
      drm/tests: Fix a use-after-free bug in __drm_kunit_helper_alloc_drm_device()

 drivers/gpu/drm/tests/drm_kunit_helpers.c | 18 +++++++++++++++++-
 include/kunit/resource.h                  | 17 +++++++++++++++++
 lib/kunit/resource.c                      | 19 +++++++++++++++++++
 3 files changed, 53 insertions(+), 1 deletion(-)
---
base-commit: 37454bcbb68601c326b58ac45f508067047d791f
change-id: 20230918-kunit-kasan-fixes-88ee78002078

Best regards,
-- 
Arthur Grillo <arthurgrillo@riseup.net>


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

end of thread, other threads:[~2023-09-30 15:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20  6:11 [PATCH 0/3] Fix a couble of bugs in drm_kunit_helpers.c Arthur Grillo
2023-09-20  6:11 ` [PATCH 1/3] drm/tests: Fix kunit_release_action ctx argument Arthur Grillo
2023-09-20  6:29   ` Maxime Ripard
2023-09-27 22:47   ` Maira Canal
2023-09-27 22:52     ` Arthur Grillo
2023-09-30 15:17       ` Maira Canal
2023-09-20  6:11 ` [PATCH 2/3] kunit: Add kunit_move_action_to_top_or_reset() to reorder actions Arthur Grillo
2023-09-22  8:00   ` David Gow
2023-09-25  9:59     ` Maxime Ripard
2023-09-20  6:11 ` [PATCH 3/3] drm/tests: Fix a use-after-free bug in __drm_kunit_helper_alloc_drm_device() Arthur Grillo
2023-09-20  6:40   ` Maxime Ripard
2023-09-20  6:54     ` Arthur Grillo

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