kselftest/arm64: Preserve any EXTRA_CONTEXT in handle_signal_copyctx()
authorMark Brown <broonie@kernel.org>
Mon, 29 Aug 2022 16:07:01 +0000 (17:07 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 7 Sep 2022 13:25:46 +0000 (14:25 +0100)
commit2fa1116bb491edd30814daa0cd0c9d3a76ba4f4d
treec7cfc8aef3c683548f017be8952ddaf45c18c7d5
parentff89a81903d3c206ed90cfe60dce900f3b7be65b
kselftest/arm64: Preserve any EXTRA_CONTEXT in handle_signal_copyctx()

When preserving the signal context for later verification by testcases
check for and include any EXTRA_CONTEXT block if enough space has been
provided.

Since the EXTRA_CONTEXT block includes a pointer to the start of the
additional data block we need to do at least some fixup on the copied
data. For simplicity in users we do this by extending the length of
the EXTRA_CONTEXT to include the following termination record, this
will cause users to see the extra data as part of the linked list of
contexts without needing any special handling. Care will be needed if
any specific tests for EXTRA_CONTEXT are added beyond the validation
done in ASSERT_GOOD_CONTEXT.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220829160703.874492-9-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/signal/test_signals_utils.c