Skip to content

KUnit-KASAN Integration

Patricia Alfonso linux-kselftest lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 6 repliesIn review
  2. v34 patches 6 repliesSuperseded
  3. v2 RFC3 patches 21 repliesSuperseded

Changes in v4 from the cover letter

- KUNIT_SET_KASAN_DATA and KUNIT_DO_EXPECT_KASAN_FAIL have been combined and included in KUNIT_DO_EXPECT_KASAN_FAIL() instead.
- Reordered logic in kasan_update_kunit_status() in report.c to be easier to read.
- Added comment to not use the name "kasan_data" for any kunit tests outside of KUNIT_EXPECT_KASAN_FAIL().

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Add KUnit Struct to Current Taskinclude/linux/sched.h+4 -01 reply
2/4KUnit: KASAN Integrationinclude/kunit/test.h include/linux/kasan.h lib/kunit/test.c +2 more+101 -94 replies
3/4KASAN: Port KASAN Tests to KUnitlib/Kconfig.kasan lib/Makefile lib/test_kasan.c +1 more+335 -3811 reply
4/4KASAN: Testing DocumentationDocumentation/dev-tools/kasan.rst+70 -00 replies

Reviews trailers per patch

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

PatchDmitry VyukovBrendan Higgins
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] KUnit-KASAN Integration

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 "[PATCH v3 kunit-next 0/2] kunit: extend kunit resources API" patchset [1]

[1] https://lore.kernel.org/linux-kselftest/[email protected]/T/#t

Changes from v3:
- KUNIT_SET_KASAN_DATA and KUNIT_DO_EXPECT_KASAN_FAIL have been combined and included in KUNIT_DO_EXPECT_KASAN_FAIL() instead.
- Reordered logic in kasan_update_kunit_status() in report.c to be easier to read.
- Added comment to not use the name "kasan_data" for any kunit tests outside of KUNIT_EXPECT_KASAN_FAIL().

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                  | 680 +++++++++++++-----------------
 lib/test_kasan_module.c           |  76 ++++
 mm/kasan/report.c                 |  30 ++
 10 files changed, 511 insertions(+), 391 deletions(-)
 create mode 100644 lib/test_kasan_module.c
Signature · 1 line
2.26.0.292.g33ef6b2f38-goog