Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v3 0/4] KUnit-KASAN Integration
@ 2020-04-01 18:09 Patricia Alfonso
  2020-04-01 18:09 ` [PATCH v3 2/4] KUnit: KASAN Integration Patricia Alfonso
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Patricia Alfonso @ 2020-04-01 18:09 UTC (permalink / raw)
  To: davidgow, brendanhiggins, aryabinin, dvyukov, mingo, peterz,
	juri.lelli, vincent.guittot
  Cc: linux-kernel, kasan-dev, kunit-dev, linux-kselftest,
	Patricia Alfonso

This patchset contains everything needed to integrate KASAN and KUnit.

KUnit will be able to:
(1) Fail tests when an unexpected KASAN error occurs
(2) Pass tests when an expected KASAN error occurs

Convert KASAN tests to KUnit with the exception of copy_user_test
because KUnit is unable to test those.

Add documentation on how to run the KASAN tests with KUnit and what to
expect when running these tests.

Depends on [1].

Changes since v2:
 - Due to Alan's changes in [1], KUnit can be built as a module.
 - The name of the tests that could not be run with KUnit has been
 changed to be more generic: test_kasan_module.
 - Documentation on how to run the new KASAN tests and what to expect
 when running them has been added.
 - Some variables and functions are now static.
 - Now save/restore panic_on_warn in a similar way to kasan_multi_shot
 and renamed the init/exit functions to be more generic to accommodate.
 - Due to [2] in kasan_strings, kasan_memchr, and
 kasan_memcmp will fail if CONFIG_AMD_MEM_ENCRYPT is enabled so return
 early and print message explaining this circumstance.
 - Changed preprocessor checks to C checks where applicable.

[1] https://lore.kernel.org/linux-kselftest/1585313122-26441-1-git-send-email-alan.maguire@oracle.com/T/#t
[2] https://bugzilla.kernel.org/show_bug.cgi?id=206337

Patricia Alfonso (4):
  Add KUnit Struct to Current Task
  KUnit: KASAN Integration
  KASAN: Port KASAN Tests to KUnit
  KASAN: Testing Documentation

 Documentation/dev-tools/kasan.rst |  70 +++
 include/kunit/test.h              |   5 +
 include/linux/kasan.h             |   6 +
 include/linux/sched.h             |   4 +
 lib/Kconfig.kasan                 |  15 +-
 lib/Makefile                      |   3 +-
 lib/kunit/test.c                  |  13 +-
 lib/test_kasan.c                  | 686 +++++++++++++-----------------
 lib/test_kasan_module.c           |  76 ++++
 mm/kasan/report.c                 |  33 ++
 10 files changed, 521 insertions(+), 390 deletions(-)
 create mode 100644 lib/test_kasan_module.c

-- 
2.26.0.rc2.310.g2932bb562d-goog


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

end of thread, other threads:[~2020-04-02 16:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-01 18:09 [PATCH v3 0/4] KUnit-KASAN Integration Patricia Alfonso
2020-04-01 18:09 ` [PATCH v3 2/4] KUnit: KASAN Integration Patricia Alfonso
2020-04-02 10:23   ` Dmitry Vyukov
2020-04-02 15:54   ` Andrey Konovalov
2020-04-02 16:37     ` Patricia Alfonso
2020-04-02 16:40       ` Andrey Konovalov
2020-04-01 18:09 ` [PATCH v3 4/4] KASAN: Testing Documentation Patricia Alfonso
2020-04-02 10:34   ` Dmitry Vyukov
2020-04-01 18:09 ` [PATCH v3 1/4] Add KUnit Struct to Current Task Patricia Alfonso
2020-04-01 18:09 ` [PATCH v3 3/4] KASAN: Port KASAN Tests to KUnit Patricia Alfonso
2020-04-02 10:32   ` Dmitry Vyukov

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