Patch "kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kselftest-arm64-fix-validatation-termination-record-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 45cd0539b8b629b90a3b63f05af3e03b190f6ad0
Author: Mark Brown <broonie@xxxxxxxxxx>
Date:   Mon Aug 29 17:06:56 2022 +0100

    kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT
    
    [ Upstream commit 5c152c2f66f9368394b89ac90dc7483476ef7b88 ]
    
    When arm64 signal context data overflows the base struct sigcontext it gets
    placed in an extra buffer pointed to by a record of type EXTRA_CONTEXT in
    the base struct sigcontext which is required to be the last record in the
    base struct sigframe. The current validation code attempts to check this
    by using GET_RESV_NEXT_HEAD() to step forward from the current record to
    the next but that is a macro which assumes it is being provided with a
    struct _aarch64_ctx and uses the size there to skip forward to the next
    record. Instead validate_extra_context() passes it a struct extra_context
    which has a separate size field. This compiles but results in us trying
    to validate a termination record in completely the wrong place, at best
    failing validation and at worst just segfaulting. Fix this by passing
    the struct _aarch64_ctx we meant to into the macro.
    
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220829160703.874492-4-broonie@xxxxxxxxxx
    Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/arm64/signal/testcases/testcases.c b/tools/testing/selftests/arm64/signal/testcases/testcases.c
index 8c2a57fc2f9c..341b3d5200bd 100644
--- a/tools/testing/selftests/arm64/signal/testcases/testcases.c
+++ b/tools/testing/selftests/arm64/signal/testcases/testcases.c
@@ -33,7 +33,7 @@ bool validate_extra_context(struct extra_context *extra, char **err)
 		return false;
 
 	fprintf(stderr, "Validating EXTRA...\n");
-	term = GET_RESV_NEXT_HEAD(extra);
+	term = GET_RESV_NEXT_HEAD(&extra->head);
 	if (!term || term->magic || term->size) {
 		*err = "Missing terminator after EXTRA context";
 		return false;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux