Resolves: RHEL-12488

This commit is contained in:
Frank Ch. Eigler 2023-11-04 12:55:10 -04:00
parent f963e1f652
commit ebae13630d
7 changed files with 27 additions and 2073 deletions

1
.gitignore vendored
View File

@ -63,3 +63,4 @@
/systemtap-4.7.tar.gz
/systemtap-4.8.tar.gz
/systemtap-4.9.tar.gz
/systemtap-5.0.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -1,99 +0,0 @@
commit 9839db5514a29cf4f58b3de8cc6155088be6d061
gpg: Signature made Sat 12 Aug 2023 02:49:26 PM EDT
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Sat Aug 12 14:28:44 2023 -0400
PR30749: correct stap --sign-module timing
Previous code signed the temp directory copy, after it had already
been copied into the cache -- so the signature never made it to a
permanent artifact.
If the module was being fetched from the cache from a previous build
run, a sign (re)attempt will still be done. This may not be
necessary, but shouldn't be harmful.
Reported-By: Renaud Métrich <rmetrich@redhat.com>
diff --git a/main.cxx b/main.cxx
index 06adb66ad..9f695cbd8 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1190,8 +1190,10 @@ passes_0_4 (systemtap_session &s)
s.mok_fingerprints.clear();
s.mok_fingerprints.push_back(mok_fingerprint);
}
- rc =
- sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
+ if (s.verbose)
+ clog << _F("Signing %s with mok key %s", s.module_filename().c_str(), mok_path.c_str())
+ << endl;
+ rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
}
#endif
@@ -1310,8 +1312,30 @@ passes_0_4 (systemtap_session &s)
if (! s.use_script_cache && s.last_pass <= 4)
s.save_module = true;
+#if HAVE_NSS
+ // PR30749
+ if (!rc && s.module_sign_given)
+ {
+ // when run on client as --sign-module, mok fingerprints are result of mokutil -l
+ // when run from server as --sign-module=PATH, mok fingerprint is given by PATH
+ string mok_path;
+ if (!s.module_sign_mok_path.empty())
+ {
+ string mok_fingerprint;
+ split_path (s.module_sign_mok_path, mok_path, mok_fingerprint);
+ s.mok_fingerprints.clear();
+ s.mok_fingerprints.push_back(mok_fingerprint);
+ }
+
+ if (s.verbose)
+ clog << _F("Signing %s with mok key %s", s.module_filename().c_str(), mok_path.c_str())
+ << endl;
+ rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
+ }
+#endif
+
// Copy module to the current directory.
- if (s.save_module && !pending_interrupts)
+ if (!rc && s.save_module && !pending_interrupts)
{
string module_src_path = s.tmpdir + "/" + s.module_filename();
string module_dest_path = s.module_filename();
@@ -1327,29 +1351,11 @@ passes_0_4 (systemtap_session &s)
}
}
-#if HAVE_NSS
- if (s.module_sign_given)
- {
- // when run on client as --sign-module, mok fingerprints are result of mokutil -l
- // when run from server as --sign-module=PATH, mok fingerprint is given by PATH
- string mok_path;
- if (!s.module_sign_mok_path.empty())
- {
- string mok_fingerprint;
- split_path (s.module_sign_mok_path, mok_path, mok_fingerprint);
- s.mok_fingerprints.clear();
- s.mok_fingerprints.push_back(mok_fingerprint);
- }
-
- rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
- }
-#endif
-
PROBE1(stap, pass4__end, &s);
return rc;
}
-
+
int
pass_5 (systemtap_session &s, vector<remote*> targets)
{

View File

@ -1,24 +0,0 @@
commit ead30c04c7157fec194c0f6d81e5c51c99bf25cf
gpg: Signature made Wed 24 May 2023 10:23:54 AM EDT
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Wed May 24 10:22:08 2023 -0400
PR30484: stap-report: scrape less of /sys /proc
Mainly: avoid process/busy parts like /proc/$pid.
diff --git a/stap-report b/stap-report
index 217ddf840..3b3a1a258 100755
--- a/stap-report
+++ b/stap-report
@@ -105,7 +105,7 @@ elif [ -f /var/log/packages ]; then
run "cat /var/log/packages | egrep 'systemtap|elfutils|kernel|gcc|dyninst|java|byteman|avahi|nss|nspr|dejagnu' | sort -k9"
fi
run "egrep 'PROBE|RANDOMIZE|RELOC|TRACE|MARKER|KALLSYM|_DEBUG_|LOCKDEP|LOCKING|MODULE|FENTRY|_SIG|BPF' /lib/modules/`uname -r`/build/.config | grep -v not.set | sort | fmt -w 80"
-run "find /debugfs /proc /sys /dev /sys/kernel/debug -type f -path '*kprobe*' -o -path '*yama*' 2>/dev/null | xargs grep -H ."
+run "find /debugfs /proc/sys /sys/kernel /dev -type f -path '*kprobe*' -o -path '*yama*' 2>/dev/null | xargs grep -H ."
run "lsmod"
run "avahi-browse -r -t _stap._tcp"
run "ifconfig -a"

View File

@ -1,64 +0,0 @@
commit ab0c5c25509600b7c9cecc9e10baebc984082b50
gpg: Signature made Fri 12 May 2023 11:18:18 AM EDT
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Fri May 12 11:13:45 2023 -0400
PR30442: failing optional statement probes should not trigger pass2 exceptions
In tapsets.cxx, query_cu() and query_module() aggressively caught &
sess-print_error'd semantic_errors from subsidiary call sites. They
are unaware of whether the probe in question is being resolved within
an optional (? or !) context. Instead of this, they now simply let
the exceptions propagate out to derive_probes() or similar, which does
know whether exceptions are errors in that context. That means
exceptions can propagate through elfutils iteration machinery too,
perhaps risking C level memory leaks, but so be it.
This fix goes well beyond statement probes per se, but hand-testing
and the testsuite appear not to show regressions related to this.
Added semok/badstmt.exp to test.
diff --git a/tapsets.cxx b/tapsets.cxx
index 859160bc5..7b7107371 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2453,8 +2453,9 @@ query_cu (Dwarf_Die * cudie, dwarf_query * q)
}
catch (const semantic_error& e)
{
- q->sess.print_error (e);
- return DWARF_CB_ABORT;
+ // q->sess.print_error (e);
+ throw;
+ // return DWARF_CB_ABORT;
}
}
@@ -2696,8 +2697,9 @@ query_module (Dwfl_Module *mod,
}
catch (const semantic_error& e)
{
- q->sess.print_error (e);
- return DWARF_CB_ABORT;
+ // q->sess.print_error (e);
+ // return DWARF_CB_ABORT;
+ throw;
}
}
diff --git a/testsuite/semok/stmtbad.stp b/testsuite/semok/stmtbad.stp
new file mode 100755
index 000000000..06780790a
--- /dev/null
+++ b/testsuite/semok/stmtbad.stp
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+exec stap -v -p2 -e 'probe oneshot {log("nothing") }
+ probe process.statement("main@*:1")? { log("yo") }' -c stap
+
+# The optional misaddressed statement probe should let stap still
+# succeed with the oneshot probe.

View File

@ -1 +1 @@
SHA512 (systemtap-4.9.tar.gz) = a2736223fee0c801c36719a0245f31ed7e2e63c30bb7d5cab631dd57e4eb10e04abf2c9b272bda2a17c207c9dd163a1eb8a3e0759eda0c781946e644625510b7
SHA512 (systemtap-5.0.tar.gz) = dc511a05e66abcbbd8c926973962751196180f3c571d0cd2a3b158ae367c5339ad32967a680ecd03224ab5f7ed2c55be7064867e4fb1b1cd7ea1cb21b2436e4c

View File

@ -45,7 +45,7 @@
%{!?with_sysusers: %global with_sysusers 0%{?fedora} >= 32 || 0%{?rhel} >= 9}
# Virt is supported on these arches, even on el7, but it's not in core EL7
%if 0%{?rhel} <= 7
%if 0%{?rhel} && 0%{?rhel} <= 7
%ifarch ppc64le aarch64
%global with_virthost 0
%endif
@ -64,9 +64,6 @@
%else
%if 0%{?rhel} >= 6
%define udevrulesdir /lib/udev/rules.d
%else
# RHEL5
%define udevrulesdir /etc/udev/rules.d
%endif
%endif
%endif
@ -83,11 +80,7 @@
%define dracutbindir %{_bindir}
%endif
%if 0%{?rhel} == 6
%{!?_rpmmacrodir: %define _rpmmacrodir /etc/rpm/}
%else
%{!?_rpmmacrodir: %define _rpmmacrodir %{_rpmconfigdir}/macros.d}
%endif
%{!?_rpmmacrodir: %define _rpmmacrodir %{_rpmconfigdir}/macros.d}
# To avoid testsuite/*/*.stp has shebang which doesn't start with '/'
%define __brp_mangle_shebangs_exclude_from .stp$
@ -122,8 +115,8 @@ m stapdev stapdev
Name: systemtap
# PRERELEASE
Version: 4.9
Release: 3%{?release_override}%{?dist}
Version: 5.0
Release: 1%{?release_override}%{?dist}
# for version, see also configure.ac
@ -156,16 +149,10 @@ Release: 3%{?release_override}%{?dist}
# intermediary stap-server for --use-server: systemtap-server (-devel unused)
Summary: Programmable system-wide instrumentation system
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz
Patch1: rhbz2223733.patch
Patch2: rhbz2223735.patch
Patch3: pr29108.patch
Patch4: pr30749.patch
# Build*
BuildRequires: make
BuildRequires: gcc-c++
@ -175,6 +162,7 @@ BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(avahi-client)
%if %{with_debuginfod}
BuildRequires: pkgconfig(libdebuginfod)
BuildRequires: pkgconfig(json-c)
%endif
%if %{with_dyninst}
BuildRequires: dyninst-devel >= 10.0
@ -226,9 +214,6 @@ BuildRequires: pkgconfig(libvirt)
BuildRequires: pkgconfig(libxml-2.0)
%endif
BuildRequires: readline-devel
%if 0%{?rhel} <= 5
BuildRequires: pkgconfig(ncurses)
%endif
%if %{with_python2_probes}
BuildRequires: python2-devel
%if 0%{?fedora} >= 1
@ -268,7 +253,7 @@ the components needed to locally develop and execute systemtap scripts.
%package server
Summary: Instrumentation System Server
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-devel = %{version}-%{release}
Conflicts: systemtap-devel < %{version}-%{release}
@ -298,7 +283,7 @@ compiles systemtap scripts to kernel objects on their demand.
%package devel
Summary: Programmable system-wide instrumentation system - development headers, tools
License: GPLv2+
License: GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND BSD-2-Clause
URL: http://sourceware.org/systemtap/
%if 0%{?rhel} >= 8 || 0%{?fedora} >= 20
@ -328,7 +313,7 @@ a copy of the standard tapset library and the runtime library C files.
%package runtime
Summary: Programmable system-wide instrumentation system - runtime
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires(pre): shadow-utils
Conflicts: systemtap-devel < %{version}-%{release}
@ -343,7 +328,7 @@ using a local or remote systemtap-devel installation.
%package client
Summary: Programmable system-wide instrumentation system - client
License: GPLv2+
License: GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
URL: http://sourceware.org/systemtap/
Requires: zip unzip
Requires: systemtap-runtime = %{version}-%{release}
@ -366,7 +351,7 @@ documentation, and a copy of the tapset library for reference.
%package initscript
Summary: Systemtap Initscripts
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap = %{version}-%{release}
%if %{with_systemd}
@ -386,7 +371,7 @@ boot-time probing if supported.
%package sdt-devel
Summary: Static probe support tools
License: GPLv2+ and Public Domain
License: GPL-2.0-or-later AND CC0-1.0
URL: http://sourceware.org/systemtap/
%if %{with_pyparsing}
%if %{with_python3}
@ -409,12 +394,12 @@ with the optional dtrace-compatibility preprocessor to process related
%package testsuite
Summary: Instrumentation System Testsuite
License: GPLv2+
License: GPL-2.0-or-later AND GPL AND GPL-2.0-only AND GPL-3.0-or-later AND MIT
URL: http://sourceware.org/systemtap/
Requires: systemtap = %{version}-%{release}
Requires: systemtap-sdt-devel = %{version}-%{release}
Requires: systemtap-server = %{version}-%{release}
Requires: dejagnu which elfutils grep nc
Requires: dejagnu which elfutils grep nc wget
%if %{with_debuginfod}
Requires: elfutils-debuginfod
%endif
@ -481,7 +466,7 @@ systemtap on the current system.
%if %{with_java}
%package runtime-java
Summary: Systemtap Java Runtime Support
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime = %{version}-%{release}
# work around fedora ci gating kvetching about i686<->x86-64 conflicts
@ -503,7 +488,7 @@ that probe Java processes running on the OpenJDK runtimes using Byteman.
%if %{with_python2_probes}
%package runtime-python2
Summary: Systemtap Python 2 Runtime Support
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime = %{version}-%{release}
@ -515,7 +500,7 @@ that probe python 2 processes.
%if %{with_python3_probes}
%package runtime-python3
Summary: Systemtap Python 3 Runtime Support
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime = %{version}-%{release}
@ -532,7 +517,7 @@ that probe python 3 processes.
%if %{with_python3_probes}
%package exporter
Summary: Systemtap-prometheus interoperation mechanism
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime = %{version}-%{release}
@ -545,7 +530,7 @@ to remote requesters on demand.
%if %{with_virthost}
%package runtime-virthost
Summary: Systemtap Cross-VM Instrumentation - host
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
# only require libvirt-libs really
#Requires: libvirt >= 1.0.2
@ -560,7 +545,7 @@ connection.
%if %{with_virtguest}
%package runtime-virtguest
Summary: Systemtap Cross-VM Instrumentation - guest
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime = %{version}-%{release}
%if %{with_systemd}
@ -581,7 +566,7 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
%if %{with_python3} && %{with_monitor}
%package jupyter
Summary: ISystemtap jupyter kernel and examples
License: GPLv2+
License: GPL-2.0-or-later
URL: http://sourceware.org/systemtap/
Requires: systemtap = %{version}-%{release}
@ -594,10 +579,6 @@ or within a container.
%prep
%setup -q
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
%build
@ -1317,6 +1298,10 @@ exit 0
# PRERELEASE
%changelog
* Fri Nov 03 2023 Frank Ch. Eigler <fche@redhat.com> - 5.0-1
- Upstream release, see wiki page below for detailed notes.
https://sourceware.org/systemtap/wiki/SystemTapReleases
* Mon Aug 14 2023 Frank Ch. Eigler <fche@redhat.com> - 4.9-3
- rhbz2231632
- rhbz2231635