linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] usercopy: Convert test_user_copy to KUnit test
@ 2024-06-12 19:59 Kees Cook
  2024-06-12 19:59 ` [PATCH v3 1/2] kunit: test: Add vm_mmap() allocation resource manager Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kees Cook @ 2024-06-12 19:59 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Kees Cook, Vitor Massaru Iha, Ivan Orlov, Brendan Higgins,
	David Gow, Rae Moar, Gustavo A. R. Silva, linux-kernel,
	linux-kselftest, kunit-dev, linux-hardening

Hi,

This builds on the proposal[1] from Mark and lets me convert the
existing usercopy selftest to KUnit. Besides adding this basic test to
the KUnit collection, it also opens the door for execve testing (which
depends on having a functional current->mm), and should provide the
basic infrastructure for adding Mark's much more complete usercopy tests.

 v3:
  - use MEMEQ KUnit helper (David)
  - exclude pathological address confusion test for systems with separate
    address spaces, noticed by David
  - add KUnit-conditional exports for alloc_mm() and arch_pick_mmap_layout()
    noticed by 0day
 v2: https://lore.kernel.org/lkml/20240610213055.it.075-kees@kernel.org/
 v1: https://lore.kernel.org/lkml/20240519190422.work.715-kees@kernel.org/

-Kees

[1] https://lore.kernel.org/lkml/20230321122514.1743889-2-mark.rutland@arm.com/

Kees Cook (2):
  kunit: test: Add vm_mmap() allocation resource manager
  usercopy: Convert test_user_copy to KUnit test

 MAINTAINERS                                |   1 +
 include/kunit/test.h                       |  17 ++
 kernel/fork.c                              |   3 +
 lib/Kconfig.debug                          |  21 +-
 lib/Makefile                               |   2 +-
 lib/kunit/Makefile                         |   1 +
 lib/kunit/user_alloc.c                     | 113 +++++++++
 lib/{test_user_copy.c => usercopy_kunit.c} | 282 ++++++++++-----------
 mm/util.c                                  |   3 +
 9 files changed, 288 insertions(+), 155 deletions(-)
 create mode 100644 lib/kunit/user_alloc.c
 rename lib/{test_user_copy.c => usercopy_kunit.c} (46%)

-- 
2.34.1


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

end of thread, other threads:[~2024-06-27 19:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-12 19:59 [PATCH v3 0/2] usercopy: Convert test_user_copy to KUnit test Kees Cook
2024-06-12 19:59 ` [PATCH v3 1/2] kunit: test: Add vm_mmap() allocation resource manager Kees Cook
2024-06-22 13:47   ` Guenter Roeck
2024-06-27 19:51     ` Kees Cook
2024-06-12 19:59 ` [PATCH v3 2/2] usercopy: Convert test_user_copy to KUnit test Kees Cook
2024-06-14 15:50   ` Shuah Khan
2024-06-17 19:00     ` Kees Cook
2024-06-17 19:17       ` Shuah Khan
2024-06-19 18:38   ` Jeff Johnson
2024-06-19 20:35     ` Kees Cook
2024-06-13  4:41 ` [PATCH v3 0/2] " David Gow
2024-06-13  5:03   ` Kees Cook

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