Blame SOURCES/rhbz1732173.patch

19f16c
commit 7be7af0fda3633cd19e499617834cf4a5f51dd55
19f16c
Author: William Cohen <wcohen@redhat.com>
19f16c
Date:   Tue Jul 23 14:24:14 2019 -0400
19f16c
19f16c
    Fix aarch64 to properly access arguments for wrapped syscalls
19f16c
    
19f16c
    Linux 4.18 added wrappers for aarch64 syscalls that pass a pointer to
19f16c
    a struct pt_regs holding the values for the actual arguments.  The
19f16c
    syscall tapsets initialize CONTEXT->sregs to point at this data
19f16c
    structure.  However, the aarch64 specific register access code was
19f16c
    using the CONTEXT->kregs and just getting the processor register state
19f16c
    when the kprobe triggered rather than the expected arguments in the
19f16c
    data structure being passed into the syscall.  The aarch64 specific
19f16c
    register code now gets the syscall arguments from the correct pt_regs
19f16c
    structure.
19f16c
19f16c
diff --git a/tapset/arm64/registers.stp b/tapset/arm64/registers.stp
19f16c
index b2e5649..8773df2 100644
19f16c
--- a/tapset/arm64/registers.stp
19f16c
+++ b/tapset/arm64/registers.stp
19f16c
@@ -58,7 +58,10 @@ function uarch_bytes:long() {
19f16c
 function _stp_get_register_by_offset:long (offset:long) %{ /* pure */
19f16c
 	long value;
19f16c
 	struct pt_regs *regs;
19f16c
-	regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs);
19f16c
+	if (CONTEXT->sregs)
19f16c
+	  regs = CONTEXT->sregs;
19f16c
+	else
19f16c
+	  regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs);
19f16c
 	if (!regs) {
19f16c
 		CONTEXT->last_error = "No registers available in this context";
19f16c
 		return;