linux-stable/tools/testing
Nick Desaulniers e0ac735ee4 selftests: sigaltstack: fix -Wuninitialized
[ Upstream commit 05107edc91 ]

Building sigaltstack with clang via:
$ ARCH=x86 make LLVM=1 -C tools/testing/selftests/sigaltstack/

produces the following warning:
  warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
  if (sp < (unsigned long)sstack ||
      ^~

Clang expects these to be declared at global scope; we've fixed this in
the kernel proper by using the macro `current_stack_pointer`. This is
defined in different headers for different target architectures, so just
create a new header that defines the arch-specific register names for
the stack pointer register, and define it for more targets (at least the
ones that support current_stack_pointer/ARCH_HAS_CURRENT_STACK_POINTER).

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/lkml/CA+G9fYsi3OOu7yCsMutpzKDnBMAzJBCPimBp86LhGBa0eCnEpA@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-26 14:28:35 +02:00
..
crypto/chacha20-s390 tools/testing/crypto: Use vzalloc instead of vmalloc+memset 2022-07-05 14:46:36 +02:00
cxl tools/testing/cxl: Add a single-port host-bridge regression config 2022-11-04 16:01:24 -07:00
fault-injection
ktest ktest.pl: Add RUN_TIMEOUT option with default unlimited 2023-03-10 09:34:27 +01:00
kunit kunit: tool: Don't download risc-v opensbi firmware with wget 2022-10-07 10:16:28 -06:00
memblock Revert "mm: Always release pages to the buddy allocator in memblock_free_late()." 2023-02-22 12:59:50 +01:00
nvdimm ndtest: Cleanup all of blk namespace specific code 2022-07-12 17:57:55 -07:00
radix-tree maple_tree: fix write memory barrier of nodes once dead for RCU mode 2023-04-20 12:35:12 +02:00
scatterlist
selftests selftests: sigaltstack: fix -Wuninitialized 2023-04-26 14:28:35 +02:00
vsock vsock_test: POLLIN + SO_RCVLOWAT test 2022-08-23 10:43:12 +02:00