1. 05 Mar, 2024 3 commits
    • Michael Ellerman's avatar
      selftests/powerpc: Fix load_unaligned_zeropad build failure · 3fe1eb4d
      Michael Ellerman authored
      This test is userspace code, but uses some kernel headers via symlinks,
      and mocks other headers, in order to test load_unaligned_zeropad().
      
      Currently the test fails to build with:
      
        In file included from load_unaligned_zeropad.c:26:
        word-at-a-time.h:7:10: fatal error: linux/bitops.h: No such file or directory
            7 | #include <linux/bitops.h>
      
      This is due to the recent changes to the kernel headers.
      
      Fix it by symlinking the new wordpart.h, and creating an empty stub for
      bitops.h which is all that's needed.
      Reported-by: default avatarSachin Sant <sachinp@linux.ibm.com>
      Tested-by: default avatarSachin Sant <sachinp@linux.ibm.com>
      Fixes: 66a5c40f ("kernel.h: removed REPEAT_BYTE from kernel.h")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20240305125644.3315910-1-mpe@ellerman.id.auSigned-off-by: default avatarKees Cook <keescook@chromium.org>
      3fe1eb4d
    • Kees Cook's avatar
      string: Convert helpers selftest to KUnit · fb57550f
      Kees Cook authored
      Convert test-string_helpers.c to KUnit so it can be easily run with
      everything else.
      
      Failure reporting doesn't need to be open-coded in most places, for
      example, forcing a failure in the expected output for upper/lower
      testing looks like this:
      
      [12:18:43] # test_upper_lower: EXPECTATION FAILED at lib/string_helpers_kunit.c:579
      [12:18:43] Expected dst == strings_upper[i].out, but
      [12:18:43]     dst == "ABCDEFGH1234567890TEST"
      [12:18:43]     strings_upper[i].out == "ABCDEFGH1234567890TeST"
      [12:18:43] [FAILED] test_upper_lower
      
      Currently passes without problems:
      
      $ ./tools/testing/kunit/kunit.py run string_helpers
      ...
      [12:23:55] Starting KUnit Kernel (1/1)...
      [12:23:55] ============================================================
      [12:23:55] =============== string_helpers (3 subtests) ================
      [12:23:55] [PASSED] test_get_size
      [12:23:55] [PASSED] test_upper_lower
      [12:23:55] [PASSED] test_unescape
      [12:23:55] ================= [PASSED] string_helpers ==================
      [12:23:55] ============================================================
      [12:23:55] Testing complete. Ran 3 tests: passed: 3
      [12:23:55] Elapsed time: 6.709s total, 0.001s configuring, 6.591s building, 0.066s running
      
      Link: https://lore.kernel.org/r/20240301202732.2688342-2-keescook@chromium.orgSigned-off-by: default avatarKees Cook <keescook@chromium.org>
      fb57550f
    • Kees Cook's avatar
      string: Convert selftest to KUnit · 29d85688
      Kees Cook authored
      Convert test_string.c to KUnit so it can be easily run with everything
      else.
      
      Additional text context is retained for failure reporting. For example,
      when forcing a bad match, we can see the loop counters reported for the
      memset() tests:
      
      [09:21:52]     # test_memset64: ASSERTION FAILED at lib/string_kunit.c:93
      [09:21:52]     Expected v == 0xa2a1a1a1a1a1a1a1ULL, but
      [09:21:52]         v == -6799976246779207263 (0xa1a1a1a1a1a1a1a1)
      [09:21:52]         0xa2a1a1a1a1a1a1a1ULL == -6727918652741279327 (0xa2a1a1a1a1a1a1a1)
      [09:21:52] i:0 j:0 k:0
      [09:21:52] [FAILED] test_memset64
      
      Currently passes without problems:
      
      $ ./tools/testing/kunit/kunit.py run string
      ...
      [09:37:40] Starting KUnit Kernel (1/1)...
      [09:37:40] ============================================================
      [09:37:40] =================== string (6 subtests) ====================
      [09:37:40] [PASSED] test_memset16
      [09:37:40] [PASSED] test_memset32
      [09:37:40] [PASSED] test_memset64
      [09:37:40] [PASSED] test_strchr
      [09:37:40] [PASSED] test_strnchr
      [09:37:40] [PASSED] test_strspn
      [09:37:40] ===================== [PASSED] string ======================
      [09:37:40] ============================================================
      [09:37:40] Testing complete. Ran 6 tests: passed: 6
      [09:37:40] Elapsed time: 6.730s total, 0.001s configuring, 6.562s building, 0.131s running
      
      Link: https://lore.kernel.org/r/20240301202732.2688342-1-keescook@chromium.orgSigned-off-by: default avatarKees Cook <keescook@chromium.org>
      29d85688
  2. 02 Mar, 2024 4 commits
  3. 01 Mar, 2024 3 commits
  4. 29 Feb, 2024 21 commits
  5. 21 Feb, 2024 8 commits
  6. 06 Feb, 2024 1 commit
    • Kees Cook's avatar
      ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL · 918327e9
      Kees Cook authored
      For simplicity in splitting out UBSan options into separate rules,
      remove CONFIG_UBSAN_SANITIZE_ALL, effectively defaulting to "y", which
      is how it is generally used anyway. (There are no ":= y" cases beyond
      where a specific file is enabled when a top-level ":= n" is in effect.)
      
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Marco Elver <elver@google.com>
      Cc: linux-doc@vger.kernel.org
      Cc: linux-kbuild@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      918327e9