kselftest/arm64: Validate signal ucontext in place
authorMark Brown <broonie@kernel.org>
Mon, 29 Aug 2022 16:06:55 +0000 (17:06 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 7 Sep 2022 13:25:46 +0000 (14:25 +0100)
commite40422c94e6a3b64d1092dcdbe1aeb4011ac3d69
tree8079bc7c47112ef51511e3a503003ac5638fe455
parent647d0933809a3e894a9cf989bc32e28244cb2c5d
kselftest/arm64: Validate signal ucontext in place

In handle_input_signal_copyctx() we use ASSERT_GOOD_CONTEXT() to validate
that the context we are saving meets expectations however we do this on
the saved copy rather than on the actual signal context passed in. This
breaks validation of EXTRA_CONTEXT since we attempt to validate the ABI
requirement that the additional space supplied is immediately after the
termination record in the standard context which will not be the case
after it has been copied to another location.

Fix this by doing the validation before we copy. Note that nothing actually
looks inside the EXTRA_CONTEXT at present.

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