diff --git a/SOURCES/rhbz1732173.patch b/SOURCES/rhbz1732173.patch new file mode 100644 index 0000000..3466649 --- /dev/null +++ b/SOURCES/rhbz1732173.patch @@ -0,0 +1,32 @@ +commit 7be7af0fda3633cd19e499617834cf4a5f51dd55 +Author: William Cohen +Date: Tue Jul 23 14:24:14 2019 -0400 + + Fix aarch64 to properly access arguments for wrapped syscalls + + Linux 4.18 added wrappers for aarch64 syscalls that pass a pointer to + a struct pt_regs holding the values for the actual arguments. The + syscall tapsets initialize CONTEXT->sregs to point at this data + structure. However, the aarch64 specific register access code was + using the CONTEXT->kregs and just getting the processor register state + when the kprobe triggered rather than the expected arguments in the + data structure being passed into the syscall. The aarch64 specific + register code now gets the syscall arguments from the correct pt_regs + structure. + +diff --git a/tapset/arm64/registers.stp b/tapset/arm64/registers.stp +index b2e5649..8773df2 100644 +--- a/tapset/arm64/registers.stp ++++ b/tapset/arm64/registers.stp +@@ -58,7 +58,10 @@ function uarch_bytes:long() { + function _stp_get_register_by_offset:long (offset:long) %{ /* pure */ + long value; + struct pt_regs *regs; +- regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs); ++ if (CONTEXT->sregs) ++ regs = CONTEXT->sregs; ++ else ++ regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs); + if (!regs) { + CONTEXT->last_error = "No registers available in this context"; + return; diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index 5bc3bb3..5555899 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -77,7 +77,7 @@ Name: %{?scl_prefix}systemtap Version: 4.1 -Release: 1%{?dist} +Release: 4%{?dist} # for version, see also configure.ac @@ -114,6 +114,7 @@ URL: http://sourceware.org/systemtap/ Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz Patch10: pr23074.patch +Patch11: rhbz1732173.patch # Build* @@ -504,6 +505,7 @@ cd .. %endif %patch10 -p1 +%patch11 -p1 %build @@ -1227,6 +1229,9 @@ done # PRERELEASE %changelog +* Mon Jul 29 2019 Frank Ch. Eigler - 4.1-4 +- rhbz1732173 (arm64 syscall parameters) + * Fri Jun 14 2019 Frank Ch. Eigler - 4.1-2 - Disable various host-service-related options. - Correct GNU_parameter_ref dwarf feature typo.