[PATCH v4] kunit: run test suites only after module initialization completes

2024-01-10 Thread Marco Pagani
larify why the start address is checked v2: - add include Fixes: 2810c1e99867 ("kunit: Fix wild-memory-access bug in kunit_free_suite_set()") Reviewed-by: David Gow Tested-by: Rae Moar Tested-by: Richard Fitzgerald Reviewed-by: Javier Martinez Canillas Signed-off-by: Marco Pagani

Re: [PATCH v3] kunit: run test suites only after module initialization completes

2024-01-09 Thread Marco Pagani
On 2024-01-08 08:27, David Gow wrote: > On Wed, 6 Dec 2023 at 23:07, Marco Pagani wrote: >> >> Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in >> kunit_free_suite_set()") fixed a wild-memory-access bug that could have >> happened during the l

[PATCH v3] kunit: run test suites only after module initialization completes

2023-12-06 Thread Marco Pagani
ot;kunit: Fix wild-memory-access bug in kunit_free_suite_set()") Tested-by: Richard Fitzgerald Reviewed-by: Javier Martinez Canillas Signed-off-by: Marco Pagani --- lib/kunit/test.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/kunit/tes

Re: [PATCH v2] kunit: run test suites only after module initialization completes

2023-11-28 Thread Marco Pagani
On 28/11/23 12:15, Javier Martinez Canillas wrote: > Marco Pagani writes: > > Hello Marco, > > [...] > >> @@ -737,12 +738,14 @@ static void kunit_module_exit(struct module *mod) >> }; >> const char *action = kunit_action(); >> >&g

[PATCH v2] kunit: run test suites only after module initialization completes

2023-11-28 Thread Marco Pagani
s is still pointing to the original address that was set when looking up the .kunit_test_suites section of the module, then the loading phase has failed and there's no memory to be freed. v2: - add include Fixes: 2810c1e99867 ("kunit: Fix wild-memory-access bug in kunit_free_suite

Re: [PATCH] kunit: run test suites only after module initialization completes

2023-10-17 Thread Marco Pagani
On 2023-10-17 03:28, Jinjie Ruan wrote: > > > On 2023/10/17 4:35, Marco Pagani wrote: >> Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in >> kunit_free_suite_set()") is causing all test suites to run (when >> built as modules) while still

[PATCH] kunit: run test suites only after module initialization completes

2023-10-16 Thread Marco Pagani
has failed and mod->kunit_suites has not been allocated using kmalloc_array(). Fixes: 2810c1e99867 ("kunit: Fix wild-memory-access bug in kunit_free_suite_set()") Signed-off-by: Marco Pagani --- lib/kunit/test.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --g

Re: [PATCH RESEND 3/3] kunit: Init and run test suites in the right state

2023-09-28 Thread Marco Pagani
_sys_init_module+0xa0/0xa0 > ? userfaultfd_unmap_prep+0x3d0/0x3d0 > ? _raw_spin_lock_bh+0xe0/0xe0 > idempotent_init_module+0x339/0x610 > ? init_module_from_file+0x130/0x130 > ? __fget_light+0x57/0x500 > __x64_sys_finit_module+0xba/0x130 > do_syscall_64+0x35/0x

[RFC PATCH] kunit: run test suites only after module initialization completes

2023-09-27 Thread Marco Pagani
Fix wild-memory-access bug in kunit_free_suite_set()") Signed-off-by: Marco Pagani --- lib/kunit/test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 421f13981412..242f26ad387a 100644 --- a/lib/kunit/test.c +++ b/lib/kun