import systemtap-4.1-6.el8

This commit is contained in:
CentOS Sources 2019-11-05 14:36:17 -05:00 committed by Andrew Lukoshko
commit a37271da03
6 changed files with 1833 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/systemtap-4.1.tar.gz

1
.systemtap.metadata Normal file
View File

@ -0,0 +1 @@
d3653e17960ac8bb23be3bb57dfa4b17dcb9d27d SOURCES/systemtap-4.1.tar.gz

51
SOURCES/pr23074.patch Normal file
View File

@ -0,0 +1,51 @@
commit 83071bc877b462eacca309fa49c9e8112fc16bdf
Author: Jafeer Uddin <juddin@redhat.com>
Date: Thu May 9 16:18:46 2019 -0400
PR23074: fix guru mode issue with generated calls to register get/set
diff --git a/elaborate.cxx b/elaborate.cxx
index 9ebf30b..fcd1d1d 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -3073,7 +3073,7 @@ public:
}
// Don't allow /* guru */ functions unless caller is privileged.
- if (!call->tok->location.file->privileged &&
+ if (!call->synthetic && !call->tok->location.file->privileged &&
s->tagged_p ("/* guru */"))
throw SEMANTIC_ERROR (_("function may not be used unless -g is specified"),
call->tok);
diff --git a/loc2stap.cxx b/loc2stap.cxx
index c1a48d0..d4fd051 100644
--- a/loc2stap.cxx
+++ b/loc2stap.cxx
@@ -1745,6 +1745,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
// it and we want to be able to restore the registers back.
functioncall *get_ptregs = new functioncall;
get_ptregs->tok = e->tok;
+ get_ptregs->synthetic = true;
if (this->userspace_p)
get_ptregs->function = std::string("__get_uregs");
else
@@ -1870,6 +1871,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
// Translation done, restore the pt_regs to its original value
functioncall *set_ptregs = new functioncall;
set_ptregs->tok = e->tok;
+ set_ptregs->synthetic = true;
if (this->userspace_p)
set_ptregs->function = std::string("__set_uregs");
else
diff --git a/staptree.h b/staptree.h
index d63156f..2735808 100644
--- a/staptree.h
+++ b/staptree.h
@@ -464,6 +464,7 @@ struct functioncall: public expression
interned_string function;
std::vector<expression*> args;
std::vector<functiondecl*> referents;
+ bool synthetic;
functioncall ();
void print (std::ostream& o) const;
void visit (visitor* u);

View File

@ -0,0 +1,148 @@
commit e037dc796de75b0d9e7e893fba6a39c2837aca2b
Author: Serhei Makarov <smakarov@redhat.com>
Date: Wed Jul 31 13:25:19 2019 -0400
stapbpf pr23875 bugfix :: allocate actual keysize in foreach to avoid stack clobber
* bpf-translate.cxx (bpf_unparser::visit_foreach_loop): allocate actual keysize.
* testsuite/systemtap.bpf/bpf_tests/foreach_string.stp: new partial PR23858 testcase,
added only the parts necessary to trigger a segfault when bugfix not applied.
diff --git a/bpf-translate.cxx b/bpf-translate.cxx
index b254be693..720e23d4e 100644
--- a/bpf-translate.cxx
+++ b/bpf-translate.cxx
@@ -1797,7 +1797,7 @@ bpf_unparser::visit_foreach_loop(foreach_loop* s)
this_prog.mk_jcond (this_ins, NE, this_prog.lookup_reg(BPF_REG_0), i0,
join_block, load_block);
- this_prog.use_tmp_space(16);
+ this_prog.use_tmp_space(2*keysize);
emit_jmp(load_block);
diff --git a/testsuite/systemtap.bpf/bpf_tests/foreach_string.stp b/testsuite/systemtap.bpf/bpf_tests/foreach_string.stp
new file mode 100644
index 000000000..956b1b409
--- /dev/null
+++ b/testsuite/systemtap.bpf/bpf_tests/foreach_string.stp
@@ -0,0 +1,119 @@
+global a[10], b[10]
+
+probe begin {
+ printf("BEGIN\n")
+
+ a["p"] = -1
+ a["q"] = 0
+ a["r"] = 1
+
+ b[-1] = "p"
+ b[0] = "q"
+ b[1] = "r"
+
+ exit()
+}
+
+global flag = 1
+global _flag = 1
+
+// XXX Split into separate probes due to stack size constraint.
+global end_probes = 0 // TODO: Remove this workaround for PR24812.
+
+probe end(1) {
+ printf("first end probe\n")
+
+ /* TODO: Requires PR23858.
+ foreach (ks- in a limit -10)
+ flag = 0
+
+ foreach (ks- in a limit 0)
+ flag = 0
+
+ found = 0
+ foreach (ks+ in a limit 1) {
+ found++
+ if (a[ks] != -1)
+ flag = 0
+ }
+
+ foreach (k in b+ limit 1) {
+ found++
+ if (k != -1)
+ flag = 0
+ }
+ if (found != 2)
+ flag = 0
+
+ foreach (ks1 in a limit 0)
+ foreach (ks2 in a)
+ flag = 0
+
+ foreach (ks1 in a)
+ foreach (ks2 in a limit 0)
+ flag = 0
+ */
+
+ x = 0
+ foreach (ks in a)
+ x += a[ks]
+ flag = flag && x == 0
+
+ if (end_probes == 0)
+ end_probes++
+ // { end_probes++; next; } // TODO: Investigate using next here.
+ else if (flag)
+ printf("END PASS\n")
+ else
+ printf("END FAIL\n")
+}
+
+probe end(2) {
+ printf("second end probe\n")
+
+ /* TODO: Requires PR23858.
+ x = -1
+ foreach (ks+ in a)
+ flag = flag && x++ == a[ks]
+ flag = flag && x == 2
+
+ x = 1
+ foreach (ks- in a)
+ {
+ flag = flag && x-- == a[ks]
+ }
+ flag = flag && x == -2
+
+ x = -1
+ y = 2
+ foreach (ks1+ in a) {
+ foreach (k2 in b-)
+ {
+ printf("got %s %d / %d %s\n", ks1, a[ks1], k2, b[k2])
+ flag = flag && x == a[ks1]
+ && y-- == k2
+ }
+ x++
+ y = 2
+ }
+ */
+
+ x = -1
+ y = 1
+ foreach (ks1+ in a) {
+ foreach (ks2- in a)
+ // TODO: Requires PR23858.
+ _flag = _flag && x == a[ks1]
+ && y-- == a[ks2]
+ x++
+ y = 1
+ }
+
+ if (end_probes == 0)
+ end_probes++
+ // { end_probes++; next; } // TODO: Investigate using next here.
+ else if (flag)
+ printf("END PASS\n")
+ else
+ printf("END FAIL\n")
+}

32
SOURCES/rhbz1732173.patch Normal file
View File

@ -0,0 +1,32 @@
commit 7be7af0fda3633cd19e499617834cf4a5f51dd55
Author: William Cohen <wcohen@redhat.com>
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;

1600
SPECS/systemtap.spec Normal file

File diff suppressed because it is too large Load Diff