linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/8] Run KUnit tests late and handle faults
@ 2024-02-29 17:04 Mickaël Salaün
  2024-02-29 17:04 ` [PATCH v1 1/8] kunit: Run tests when the kernel is fully setup Mickaël Salaün
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Mickaël Salaün @ 2024-02-29 17:04 UTC (permalink / raw)
  To: Brendan Higgins, David Gow, Kees Cook, Rae Moar, Shuah Khan
  Cc: Mickaël Salaün, Alan Maguire, Borislav Petkov,
	Dave Hansen, H . Peter Anvin, Ingo Molnar, James Morris,
	Luis Chamberlain, Madhavan T . Venkataraman, Marco Pagani,
	Paolo Bonzini, Sean Christopherson, Stephen Boyd, Thara Gopinath,
	Thomas Gleixner, Vitaly Kuznetsov, Wanpeng Li, Zahra Tarkhani,
	kvm, linux-hardening, linux-hyperv, linux-kernel,
	linux-security-module, linux-um, x86

Hi,

This patch series moves KUnit test execution at the very end of kernel
initialization, just before launching the init process.  This opens the
way to test any kernel code in its normal state (i.e. fully
initialized).

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

New tests check NULL pointer dereference and read-only memory, 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

Regards,

Mickaël Salaün (8):
  kunit: Run tests when the kernel is fully setup
  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 faults

 include/kunit/test.h                |  24 +++++-
 include/kunit/try-catch.h           |   3 -
 init/main.c                         |   4 +-
 lib/bitfield_kunit.c                |   8 +-
 lib/checksum_kunit.c                |   2 +-
 lib/kunit/executor.c                |  81 ++++++++++++++------
 lib/kunit/kunit-example-test.c      |   6 +-
 lib/kunit/kunit-test.c              | 115 +++++++++++++++++++++++++++-
 lib/kunit/try-catch.c               |  33 +++++---
 lib/kunit_iov_iter.c                |  70 ++++++++---------
 tools/testing/kunit/kunit_kernel.py |   6 +-
 11 files changed, 261 insertions(+), 91 deletions(-)


base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b
-- 
2.44.0


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

end of thread, other threads:[~2024-03-01 20:43 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 17:04 [PATCH v1 0/8] Run KUnit tests late and handle faults Mickaël Salaün
2024-02-29 17:04 ` [PATCH v1 1/8] kunit: Run tests when the kernel is fully setup Mickaël Salaün
2024-02-29 18:21   ` Kees Cook
2024-03-01  5:29   ` kernel test robot
2024-03-01  7:14   ` David Gow
2024-03-01 19:03     ` Mickaël Salaün
2024-03-01 11:03   ` kernel test robot
2024-02-29 17:04 ` [PATCH v1 2/8] kunit: Handle thread creation error Mickaël Salaün
2024-02-29 18:21   ` Kees Cook
2024-02-29 17:04 ` [PATCH v1 3/8] kunit: Fix kthread reference Mickaël Salaün
2024-02-29 18:22   ` Kees Cook
2024-02-29 17:04 ` [PATCH v1 4/8] kunit: Fix timeout message Mickaël Salaün
2024-02-29 18:22   ` Kees Cook
2024-02-29 17:04 ` [PATCH v1 5/8] kunit: Handle test faults Mickaël Salaün
2024-02-29 18:24   ` Kees Cook
2024-03-01 19:09     ` Mickaël Salaün
2024-02-29 17:04 ` [PATCH v1 6/8] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests Mickaël Salaün
2024-02-29 18:24   ` Kees Cook
2024-02-29 17:04 ` [PATCH v1 7/8] kunit: Print last test location on fault Mickaël Salaün
2024-02-29 18:26   ` Kees Cook
2024-02-29 17:04 ` [PATCH v1 8/8] kunit: Add tests for faults Mickaël Salaün
2024-02-29 18:28   ` Kees Cook
2024-03-01 19:16     ` Mickaël Salaün
2024-03-01 20:42   ` kernel test robot
2024-03-01  7:15 ` [PATCH v1 0/8] Run KUnit tests late and handle faults David Gow
2024-03-01 19:19   ` Mickaël Salaün

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).