Re: [PATCH 2/4] selftests/arm: Add signal tests

From: Dev Jain
Date: Wed Apr 10 2024 - 00:43:52 EST



On 4/7/24 02:58, Muhammad Usama Anjum wrote:
On 4/5/24 1:44 PM, Dev Jain wrote:
This patch introduces two signal tests, and generic test wrappers similar to
selftests/arm64/signal directory, along with the mangling testcases found
therein. arm_cpsr, dumped by the kernel to user space in the ucontext structure
to the signal handler, is mangled with. The kernel must spot this illegal
attempt and the testcases are expected to terminate via SEGV.

Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
---
.../selftests/arm/signal/test_signals.c | 27 ++
.../selftests/arm/signal/test_signals.h | 74 +++++
.../selftests/arm/signal/test_signals_utils.c | 257 ++++++++++++++++++
.../selftests/arm/signal/test_signals_utils.h | 128 +++++++++
.../signal/testcases/mangle_cpsr_aif_bits.c | 33 +++
.../mangle_cpsr_invalid_compat_toggle.c | 29 ++
Too many files/tests in one patch. Break this patch logically into multiple
tests for easy to review and follow.


In this particular case, I am not sure about the utility of doing that.

My idea was to put the wrapper infrastructure and the individual testcases

into a single patch for ease of comparison with selftests/arm64; this will

actually help in pointing out mistakes or suggesting improvements.


6 files changed, 548 insertions(+)
create mode 100644 tools/testing/selftests/arm/signal/test_signals.c
create mode 100644 tools/testing/selftests/arm/signal/test_signals.h
create mode 100644 tools/testing/selftests/arm/signal/test_signals_utils.c
create mode 100644 tools/testing/selftests/arm/signal/test_signals_utils.h
create mode 100644 tools/testing/selftests/arm/signal/testcases/mangle_cpsr_aif_bits.c
create mode 100644 tools/testing/selftests/arm/signal/testcases/mangle_cpsr_invalid_compat_toggle.c