Skip to content

fortify: Add KUnit tests for runtime overflows

Kees Cook linux-hardening lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 0 repliesNew
  2. v210 patches 14 repliesSuperseded
  3. v19 patches 19 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5fortify: Split reporting and avoid passing string pointerarch/arm/boot/compressed/misc.c arch/x86/boot/compressed/misc.c include/linux/fortify-string.h +2 more+83 -270 replies
2/5fortify: Allow KUnit test to build without FORTIFYlib/Kconfig.debug lib/fortify_kunit.c+15 -10 replies
3/5fortify: Provide KUnit counters for failure testinginclude/linux/fortify-string.h lib/fortify_kunit.c lib/string_helpers.c+66 -200 replies
4/5fortify: Add KUnit tests for runtime overflowslib/Makefile lib/fortify_kunit.c+606 -20 replies
5/5fortify: Improve buffer overflow reportingarch/arm/boot/compressed/misc.c arch/x86/boot/compressed/misc.c include/linux/fortify-string.h +2 more+39 -340 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchAlexander Lobakin
1/5R-b
2/5
3/5
4/5
5/5

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

Read the v3 thread

Cover letter [PATCH v3 0/5] fortify: Add KUnit tests for runtime overflows

Hi,

This series is the rest of the v2 series that was half landed last year, and finally introduces KUnit runtime testing of the CONFIG_FORTIFY_SOURCE APIs. Additionally FORTIFY failure messages are improved to give more context about read/write and sizes.

-Kees

v3
- rebase (goodbye strlcpy)
- avoid extra macros for replacing fortify_panic() (nick)
- generally clean up macro usage
- avoid build warnings when testing known overflow conditions
v2 https://lore.kernel.org/all/[email protected]/
v1 https://lore.kernel.org/lkml/[email protected]/

Kees Cook (5):
fortify: Split reporting and avoid passing string pointer
fortify: Allow KUnit test to build without FORTIFY
fortify: Provide KUnit counters for failure testing
fortify: Add KUnit tests for runtime overflows
fortify: Improve buffer overflow reporting

 arch/arm/boot/compressed/misc.c |   2 +-
 arch/x86/boot/compressed/misc.c |   2 +-
 include/linux/fortify-string.h  | 100 +++--
 lib/Kconfig.debug               |   2 +-
 lib/Makefile                    |   1 +
 lib/fortify_kunit.c             | 662 +++++++++++++++++++++++++++++++-
 lib/string_helpers.c            |  26 +-
 tools/objtool/noreturns.h       |   2 +-
 8 files changed, 761 insertions(+), 36 deletions(-)
Signature · 1 line
2.34.1