hardening updates for v6.9-rc1

- string.h and related header cleanups (Tanzir Hasan, Andy Shevchenko)

- VMCI memcpy() usage and struct_size() cleanups (Vasiliy Kovalev, Harshit
  Mogalapalli)

- selftests/powerpc: Fix load_unaligned_zeropad build failure (Michael
  Ellerman)

- hardened Kconfig fragment updates (Marco Elver, Lukas Bulwahn)

- Handle tail call optimization better in LKDTM (Douglas Anderson)

- Use long form types in overflow.h (Andy Shevchenko)

- Add flags param to string_get_size() (Andy Shevchenko)

- Add Coccinelle script for potential struct_size() use (Jacob Keller)

- Fix objtool corner case under KCFI (Josh Poimboeuf)

- Drop 13 year old backward compat CAP_SYS_ADMIN check (Jingzi Meng)

- Add str_plural() helper (Michal Wajdeczko, Kees Cook)

- Ignore relocations in .notes section

- Add comments to explain how __is_constexpr() works

- Fix m68k stack alignment expectations in stackinit Kunit test

- Convert string selftests to KUnit

- Add KUnit tests for fortified string functions

- Improve reporting during fortified string warnings

- Allow non-type arg to type_max() and type_min()

- Allow strscpy() to be called with only 2 arguments

- Add binary mode to leaking_addresses scanner

- Various small cleanups to leaking_addresses scanner

- Adding wrapping_*() arithmetic helper

- Annotate initial signed integer wrap-around in refcount_t

- Add explicit UBSAN section to MAINTAINERS

- Fix UBSAN self-test warnings

- Simplify UBSAN build via removal of CONFIG_UBSAN_SANITIZE_ALL

- Reintroduce UBSAN's signed overflow sanitizer
selftests/powerpc: Fix load_unaligned_zeropad build failure

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: Sachin Sant <sachinp@linux.ibm.com>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: 66a5c40f60f5 ("kernel.h: removed REPEAT_BYTE from kernel.h")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20240305125644.3315910-1-mpe@ellerman.id.au
Signed-off-by: Kees Cook <keescook@chromium.org>
2 files changed