Skip to content

Handle faults in KUnit tests

Mickaël Salaün kvm linux-hardening linux-hyperv linux-kselftest linux-security-module linux-um lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest posting 2/27 patches 1 replyIn review
  2. v4 posting 1/27 patches 3 repliesSuperseded
  3. v37 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v27 patches14 repliesSuperseded

Patches in v4 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7kunit: Handle thread creation errorlib/kunit/try-catch.c+1 -00 replies
2/7kunit: Fix kthread referencelib/kunit/try-catch.c+6 -30 replies
3/7kunit: Fix timeout messagelib/kunit/try-catch.c+2 -10 replies
4/7kunit: Handle test faultsinclude/kunit/try-catch.h kernel/kthread.c lib/kunit/try-catch.c+13 -100 replies
5/7kunit: Fix KUNIT_SUCCESS() calls in iov_iter testslib/kunit_iov_iter.c+9 -90 replies
6/7kunit: Print last test location on faultinclude/kunit/test.h lib/kunit/try-catch.c+28 -60 replies
7/7kunit: Add tests for faultlib/kunit/kunit-test.c+44 -10 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchKees CookRae MoarDavid Gow
1/7R-b R-b R-b
2/7R-b R-b R-b
3/7R-b R-b R-b
4/7R-b T-b R-b
5/7R-b R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 RESEND 0/7] Handle faults in KUnit tests

Hi,

This patch series teaches KUnit to handle kthread faults as errors, and it brings a few related fixes and improvements.

Shuah, everything should be OK now, could you please merge this series?

All these tests pass (on top of v6.8):
./tools/testing/kunit/kunit.py run --alltests ./tools/testing/kunit/kunit.py run --alltests --arch x86_64 ./tools/testing/kunit/kunit.py run --alltests --arch arm64 \
--cross_compile=aarch64-linux-gnu-

I also built and ran KUnit tests as a kernel module.

A new test case check NULL pointer dereference, which wasn't possible before.

This is useful to test current kernel self-protection mechanisms or future ones such as Heki: https://github.com/heki-linux

Previous versions:
v3: https://lore.kernel.org/r/[email protected]
v2: https://lore.kernel.org/r/[email protected]
v1: https://lore.kernel.org/r/[email protected]

Regards,

Mickaël Salaün (7):
kunit: Handle thread creation error
kunit: Fix kthread reference
kunit: Fix timeout message
kunit: Handle test faults
kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests
kunit: Print last test location on fault
kunit: Add tests for fault

 include/kunit/test.h      | 24 ++++++++++++++++++---
 include/kunit/try-catch.h |  3 ---
 kernel/kthread.c          |  1 +
 lib/kunit/kunit-test.c    | 45 ++++++++++++++++++++++++++++++++++++++-
 lib/kunit/try-catch.c     | 38 ++++++++++++++++++++++-----------
 lib/kunit_iov_iter.c      | 18 ++++++++--------
 6 files changed, 101 insertions(+), 28 deletions(-)

base-commit: e8f897f4afef0031fe618a8e94127a0934896aba

Signature · 1 line
2.44.0