linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] kunit: Fix some bugs in kunit_filter_suites()
@ 2023-09-03  7:10 Jinjie Ruan
  2023-09-03  7:10 ` [PATCH v2 1/4] kunit: Fix wild-memory-access bug in kunit_free_suite_set() Jinjie Ruan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jinjie Ruan @ 2023-09-03  7:10 UTC (permalink / raw)
  To: brendan.higgins, davidgow, skhan, jk, dlatypov, rmoar,
	linux-kselftest, kunit-dev
  Cc: ruanjinjie

The state handle in kunit_module_notify() is not correct when
the mod->state switch from MODULE_STATE_COMING to MODULE_STATE_GOING.

And it's necessary to check NULL for kzalloc() in
kunit_parse_glob_filter().

The order in which memory is released in err path in kunit_filter_suites()
is also problematic.

And there is a possible memory leak in kunit_filter_suites().

This patchset fix the above issues.

Changes in v2:
- Adjust the 4th patch to be the second.
- Add goto labels in kunit_filter_suites() and adapt to it.
- Fix the issue in the third patch.
- Update the commit message and title.

Jinjie Ruan (4):
  kunit: Fix wild-memory-access bug in kunit_free_suite_set()
  kunit: Fix the wrong err path and add goto labels in
    kunit_filter_suites()
  kunit: Fix possible null-ptr-deref in kunit_parse_glob_filter()
  kunit: Fix possible memory leak in kunit_filter_suites()

 lib/kunit/executor.c | 48 ++++++++++++++++++++++++++++++--------------
 lib/kunit/test.c     |  3 ++-
 2 files changed, 35 insertions(+), 16 deletions(-)

-- 
2.34.1


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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-03  7:10 [PATCH v2 0/4] kunit: Fix some bugs in kunit_filter_suites() Jinjie Ruan
2023-09-03  7:10 ` [PATCH v2 1/4] kunit: Fix wild-memory-access bug in kunit_free_suite_set() Jinjie Ruan
2023-09-05  7:12   ` David Gow
2023-09-03  7:10 ` [PATCH v2 2/4] kunit: Fix the wrong err path and add goto labels in kunit_filter_suites() Jinjie Ruan
2023-09-03  9:43   ` kernel test robot
2023-09-03  9:43   ` kernel test robot
2023-09-05  7:12   ` David Gow
2023-09-03  7:10 ` [PATCH v2 3/4] kunit: Fix possible null-ptr-deref in kunit_parse_glob_filter() Jinjie Ruan
2023-09-05  7:13   ` David Gow
2023-09-03  7:10 ` [PATCH v2 4/4] kunit: Fix possible memory leak in kunit_filter_suites() Jinjie Ruan
2023-09-05  7:13   ` David Gow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).