From 3ad31e886a605c5dbe6a6f21be4d013da3d9951d Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 18 2021 14:06:41 +0000 Subject: [PATCH 1/9] Introduce CI gating tests. --- diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..84b7773 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,20 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..85710d6 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: tmt diff --git a/tests/Regression/GNU-Attribute-notes-not-recognized/Makefile b/tests/Regression/GNU-Attribute-notes-not-recognized/Makefile new file mode 100644 index 0000000..03e071d --- /dev/null +++ b/tests/Regression/GNU-Attribute-notes-not-recognized/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized +# Description: GNU-Attribute-notes-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/GNU-Attribute-notes-not-recognized +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: GNU-Attribute-notes-not-recognized" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: bash" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1650125" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/GNU-Attribute-notes-not-recognized/PURPOSE b/tests/Regression/GNU-Attribute-notes-not-recognized/PURPOSE new file mode 100644 index 0000000..8f81c9c --- /dev/null +++ b/tests/Regression/GNU-Attribute-notes-not-recognized/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized +Description: GNU-Attribute-notes-not-recognized +Author: Martin Cermak +Bug summary: elfutils doesn't recognize GNU Attribute notes +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650125 diff --git a/tests/Regression/GNU-Attribute-notes-not-recognized/main.fmf b/tests/Regression/GNU-Attribute-notes-not-recognized/main.fmf new file mode 100644 index 0000000..896cbd2 --- /dev/null +++ b/tests/Regression/GNU-Attribute-notes-not-recognized/main.fmf @@ -0,0 +1,16 @@ +summary: GNU-Attribute-notes-not-recognized +description: | + Bug summary: elfutils doesn't recognize GNU Attribute notes + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650125 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- bash +duration: 48h +extra-summary: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized +extra-task: /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized diff --git a/tests/Regression/GNU-Attribute-notes-not-recognized/runtest.sh b/tests/Regression/GNU-Attribute-notes-not-recognized/runtest.sh new file mode 100755 index 0000000..d60f5ac --- /dev/null +++ b/tests/Regression/GNU-Attribute-notes-not-recognized/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/GNU-Attribute-notes-not-recognized +# Description: GNU-Attribute-notes-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # Rely on that /bin/bash is annobin-annotated per + # - https://fedoraproject.org/wiki/Toolchain/Watermark + # - https://fedoraproject.org/wiki/Changes/Annobin + # Seems to work fine with bash-4.4.19-6.el8 and elfutils-0.174-5.el8. + set -o pipefail + rlRun "eu-readelf -n /bin/bash | grep -2 '^ GA' | fgrep 'GNU Build Attribute' | tail -50" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/GNU-Property-notes-not-recognized/Makefile b/tests/Regression/GNU-Property-notes-not-recognized/Makefile new file mode 100644 index 0000000..0cd42d7 --- /dev/null +++ b/tests/Regression/GNU-Property-notes-not-recognized/Makefile @@ -0,0 +1,66 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/GNU-Property-notes-not-recognized +# Description: GNU-Property-notes-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/GNU-Property-notes-not-recognized +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE gnu_props.S + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: GNU-Property-notes-not-recognized" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: yum" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1650120" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/GNU-Property-notes-not-recognized/PURPOSE b/tests/Regression/GNU-Property-notes-not-recognized/PURPOSE new file mode 100644 index 0000000..18b0af8 --- /dev/null +++ b/tests/Regression/GNU-Property-notes-not-recognized/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/GNU-Property-notes-not-recognized +Description: GNU-Property-notes-not-recognized +Author: Martin Cermak +Bug summary: elfutils doesn't recognize GNU Property notes +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650120 diff --git a/tests/Regression/GNU-Property-notes-not-recognized/gnu_props.S b/tests/Regression/GNU-Property-notes-not-recognized/gnu_props.S new file mode 100644 index 0000000..83e5bcc --- /dev/null +++ b/tests/Regression/GNU-Property-notes-not-recognized/gnu_props.S @@ -0,0 +1,45 @@ +#define NT_GNU_PROPERTY_TYPE_0 5 +#define GNU_PROPERTY_STACK_SIZE 1 +#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 + +/* Normal notes always have alignment and padding of 4 bytes, + but GNU Property notes use 4 byte words, with 8 byte padding + for ELFCLASS64. */ +#if __SIZEOF_PTRDIFF_T__ == 8 +# define ALIGN 3 +#elif __SIZEOF_PTRDIFF_T__ == 4 +# define ALIGN 2 +#endif + + .section ".note.gnu.property", "a" + .p2align ALIGN + /* First note. */ + .long 1f - 0f /* name length. */ + .long 4f - 2f /* data length. */ + .long NT_GNU_PROPERTY_TYPE_0 /* note type. */ +0: + .asciz "GNU" /* vendor name. */ +1: + .p2align ALIGN /* Padding. */ +2: + .long GNU_PROPERTY_STACK_SIZE /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .dc.a 0x280000 /* Stack size. */ +4: + .p2align ALIGN + + /* Second note. */ + .long 6f - 5f /* name length. */ + .long 8f - 7f /* data length. */ + .long NT_GNU_PROPERTY_TYPE_0 /* note type. */ +5: + .asciz "GNU" /* vendor name. */ +6: + .p2align ALIGN /* Padding. */ +7: + .long GNU_PROPERTY_NO_COPY_ON_PROTECTED /* pr_type. */ + .long 0 /* pr_datasz. */ + /* No data. */ +8: + .p2align ALIGN diff --git a/tests/Regression/GNU-Property-notes-not-recognized/main.fmf b/tests/Regression/GNU-Property-notes-not-recognized/main.fmf new file mode 100644 index 0000000..0937c5c --- /dev/null +++ b/tests/Regression/GNU-Property-notes-not-recognized/main.fmf @@ -0,0 +1,17 @@ +summary: GNU-Property-notes-not-recognized +description: | + Bug summary: elfutils doesn't recognize GNU Property notes + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650120 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- gcc +- yum +duration: 48h +extra-summary: /tools/elfutils/Regression/GNU-Property-notes-not-recognized +extra-task: /tools/elfutils/Regression/GNU-Property-notes-not-recognized diff --git a/tests/Regression/GNU-Property-notes-not-recognized/runtest.sh b/tests/Regression/GNU-Property-notes-not-recognized/runtest.sh new file mode 100755 index 0000000..f56eb69 --- /dev/null +++ b/tests/Regression/GNU-Property-notes-not-recognized/runtest.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/GNU-Property-notes-not-recognized +# Description: GNU-Property-notes-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStart FAIL Setup + rlAssertRpm $PACKAGE + rlRun "TMP=$(mktemp -d)" + rlRun "cp gnu_props.S $TMP" + rlRun "pushd $TMP" + + # This is an attempt to set up a test environment + # allowing the compat arch compilation (-m3[12]) : + rlRun "yum -y install --skip-broken --setopt=multilib_policy=all libgcc glibc-devel" + + set -x + arch_compile_flags="" + for i in \-m64 \-m32 \-m31; do + echo "int main () {}" | gcc $i -o /dev/null -xc - && arch_compile_flags="$arch_compile_flags $i" + done + set +x + rlPhaseEnd + + testcnt=0 + # gcc-8.2.1-3.4.el8.aarch64 doesn't accept -m64. But it works as expected + # when this switch gets omitted. So, on that platform we'll not have -m64 + # within the $arch_compile_flags, but we'll still iterate over ' ' : + for m in ' ' $arch_compile_flags; do + rlPhaseStart FAIL "Test compile flag \'$m\'" + rlRun "gcc $m -c gnu_props.S -o gnu_props.o" + rlRun "eu-readelf -n ./gnu_props.o |& tee out.txt" + rlRun "fgrep 'STACK_SIZE 0x280000' out.txt" + rm gnu_props.o out.txt + testcnt=$((testcnt + 1)) + rlPhaseEnd + done + + rlPhaseStart FAIL Cleanup + test $testcnt -eq 0 && rlFail "No test was performed." + rlRun "popd" + rlRun "rm -r $TMP" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/RFE-support-reading-compressed-ELF-objects/Makefile b/tests/Regression/RFE-support-reading-compressed-ELF-objects/Makefile new file mode 100644 index 0000000..13ee890 --- /dev/null +++ b/tests/Regression/RFE-support-reading-compressed-ELF-objects/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects +# Description: Test for BZ#1674430 (RFE support reading compressed ELF objects) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1674430 (RFE support reading compressed ELF objects)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1674430" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/RFE-support-reading-compressed-ELF-objects/PURPOSE b/tests/Regression/RFE-support-reading-compressed-ELF-objects/PURPOSE new file mode 100644 index 0000000..5d1cbba --- /dev/null +++ b/tests/Regression/RFE-support-reading-compressed-ELF-objects/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects +Description: Test for BZ#1674430 (RFE support reading compressed ELF objects) +Author: Martin Cermak +Bug summary: RFE: support reading compressed ELF objects +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1674430 diff --git a/tests/Regression/RFE-support-reading-compressed-ELF-objects/main.fmf b/tests/Regression/RFE-support-reading-compressed-ELF-objects/main.fmf new file mode 100644 index 0000000..3053404 --- /dev/null +++ b/tests/Regression/RFE-support-reading-compressed-ELF-objects/main.fmf @@ -0,0 +1,15 @@ +summary: Test for BZ#1674430 (RFE support reading compressed ELF objects) +description: | + Bug summary: RFE: support reading compressed ELF objects + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1674430 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects +extra-task: /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects diff --git a/tests/Regression/RFE-support-reading-compressed-ELF-objects/runtest.sh b/tests/Regression/RFE-support-reading-compressed-ELF-objects/runtest.sh new file mode 100755 index 0000000..c39793d --- /dev/null +++ b/tests/Regression/RFE-support-reading-compressed-ELF-objects/runtest.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/RFE-support-reading-compressed-ELF-objects +# Description: Test for BZ#1674430 (RFE support reading compressed ELF objects) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" +KOXZS_TO_TEST=20 + +rlJournalStart + rlPhaseStartTest + # Look to see that dwelf_elf_begin is now in libdw.so + rlRun "eu-nm -D $(ldd $(which eu-readelf) | awk '/libdw.so/ {print $3}') | fgrep 'dwelf_elf_begin'" + # Also eu-readelf now takes advantage of dwelf_elf_begin() to directly read compressed ELF files. + for koxz in $(find /usr/lib/modules/ | fgrep '.ko.xz' | shuf -n $KOXZS_TO_TEST); do + rlRun "eu-readelf -n $koxz" + done + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/Makefile b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/Makefile new file mode 100644 index 0000000..3923e29 --- /dev/null +++ b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized +# Description: SHT_X86_64_UNWIND-section-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE m.o + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: SHT_X86_64_UNWIND-section-not-recognized" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1650114" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/PURPOSE b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/PURPOSE new file mode 100644 index 0000000..a725362 --- /dev/null +++ b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized +Description: SHT_X86_64_UNWIND-section-not-recognized +Author: Martin Cermak +Bug summary: elfutils doesn't recognize gold linker SHT_X86_64_UNWIND section +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650114 diff --git a/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/m.o b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/m.o new file mode 100644 index 0000000..cd5b639 Binary files /dev/null and b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/m.o differ diff --git a/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/main.fmf b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/main.fmf new file mode 100644 index 0000000..669db9f --- /dev/null +++ b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/main.fmf @@ -0,0 +1,15 @@ +summary: SHT_X86_64_UNWIND-section-not-recognized +description: | + Bug summary: elfutils doesn't recognize gold linker SHT_X86_64_UNWIND section + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1650114 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized +extra-task: /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized diff --git a/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/runtest.sh b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/runtest.sh new file mode 100755 index 0000000..cd5a8d6 --- /dev/null +++ b/tests/Regression/SHT_X86_64_UNWIND-section-not-recognized/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/SHT_X86_64_UNWIND-section-not-recognized +# Description: SHT_X86_64_UNWIND-section-not-recognized +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + set -o pipefail + rlRun "eu-readelf -S m.o | fgrep .eh_frame | fgrep X86_64_UNWIND" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/Makefile b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/Makefile new file mode 100644 index 0000000..d8c5c79 --- /dev/null +++ b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn +# Description: abrt-faf-elfutils-IO-default-xsputn +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE eu-readelf-n-crash.core.xz + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: abrt-faf-elfutils-IO-default-xsputn" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils xz" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1262839" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/PURPOSE b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/PURPOSE new file mode 100644 index 0000000..33a3c69 --- /dev/null +++ b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn +Description: abrt-faf-elfutils-IO-default-xsputn +Author: Martin Cermak +Bug summary: [abrt] [faf] elfutils: _IO_default_xsputn(): /usr/bin/eu-readelf killed by 11 +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262839 diff --git a/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/eu-readelf-n-crash.core.xz b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/eu-readelf-n-crash.core.xz new file mode 100644 index 0000000..9326d2e Binary files /dev/null and b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/eu-readelf-n-crash.core.xz differ diff --git a/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/main.fmf b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/main.fmf new file mode 100644 index 0000000..48f5fc9 --- /dev/null +++ b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/main.fmf @@ -0,0 +1,16 @@ +summary: abrt-faf-elfutils-IO-default-xsputn +description: | + Bug summary: [abrt] [faf] elfutils: _IO_default_xsputn(): /usr/bin/eu-readelf killed by 11 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262839 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- xz +duration: 5m +extra-summary: /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn +extra-task: /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn diff --git a/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/runtest.sh b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/runtest.sh new file mode 100755 index 0000000..685d143 --- /dev/null +++ b/tests/Regression/abrt-faf-elfutils-IO-default-xsputn/runtest.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/abrt-faf-elfutils-IO-default-xsputn +# Description: abrt-faf-elfutils-IO-default-xsputn +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "TMPD=$(mktemp -d)" + rlRun "cp eu-readelf-n-crash.core.xz $TMPD/" + rlRun "pushd $TMPD" + rlRun "unxz eu-readelf-n-crash.core.xz" + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-readelf -n ./eu-readelf-n-crash.core" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TMPD" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/add-ppc64-fallback-unwinder/Makefile b/tests/Regression/add-ppc64-fallback-unwinder/Makefile new file mode 100644 index 0000000..c6ab7c3 --- /dev/null +++ b/tests/Regression/add-ppc64-fallback-unwinder/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/add-ppc64-fallback-unwinder +# Description: add-ppc64-fallback-unwinder +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/add-ppc64-fallback-unwinder +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 output.ref + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: add-ppc64-fallback-unwinder" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: bzip2" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1454754" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/add-ppc64-fallback-unwinder/PURPOSE b/tests/Regression/add-ppc64-fallback-unwinder/PURPOSE new file mode 100644 index 0000000..198b5c0 --- /dev/null +++ b/tests/Regression/add-ppc64-fallback-unwinder/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/add-ppc64-fallback-unwinder +Description: add-ppc64-fallback-unwinder +Author: Martin Cermak +Bug summary: Add ppc64 fallback unwinder to elfutils libdw +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1454754 diff --git a/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.core.bz2 b/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.core.bz2 new file mode 100644 index 0000000..e63babf Binary files /dev/null and b/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.core.bz2 differ diff --git a/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.exec.bz2 b/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.exec.bz2 new file mode 100644 index 0000000..ed1352a Binary files /dev/null and b/tests/Regression/add-ppc64-fallback-unwinder/backtrace.ppc64le.fp.exec.bz2 differ diff --git a/tests/Regression/add-ppc64-fallback-unwinder/main.fmf b/tests/Regression/add-ppc64-fallback-unwinder/main.fmf new file mode 100644 index 0000000..844bc0f --- /dev/null +++ b/tests/Regression/add-ppc64-fallback-unwinder/main.fmf @@ -0,0 +1,16 @@ +summary: add-ppc64-fallback-unwinder +description: | + Bug summary: Add ppc64 fallback unwinder to elfutils libdw + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1454754 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- bzip2 +duration: 10m +extra-summary: /tools/elfutils/Regression/add-ppc64-fallback-unwinder +extra-task: /tools/elfutils/Regression/add-ppc64-fallback-unwinder diff --git a/tests/Regression/add-ppc64-fallback-unwinder/output.ref b/tests/Regression/add-ppc64-fallback-unwinder/output.ref new file mode 100644 index 0000000..5f21abd --- /dev/null +++ b/tests/Regression/add-ppc64-fallback-unwinder/output.ref @@ -0,0 +1,17 @@ +PID 23727 - core +TID 23728: +#0 0x00000000100104bc raise +#1 0x0000000010002a1c sigusr2 +#2 0x0000000010002a1c sigusr2 +#3 0x0000000010002b38 stdarg +#4 0x0000000010002bc4 backtracegen +#5 0x0000000010002bf0 start +#6 0x0000000010004c28 start_thread +eu-stack: dwfl_thread_getframes tid 23728 at 0x10004c27 in /root/mjw/elfutils/tests/backtrace.ppc64le.fp.exec: (null) +TID 23727: +#0 0x0000000010006034 pthread_join +#1 0x00000000100025bc main +#2 0x00000000100025bc main +#3 0x00000000100123c4 generic_start_main +#4 0x0000000010012570 __libc_start_main +eu-stack: dwfl_thread_getframes tid 23727 at 0x1001256f in /root/mjw/elfutils/tests/backtrace.ppc64le.fp.exec: No DWARF information found diff --git a/tests/Regression/add-ppc64-fallback-unwinder/runtest.sh b/tests/Regression/add-ppc64-fallback-unwinder/runtest.sh new file mode 100755 index 0000000..dcc6717 --- /dev/null +++ b/tests/Regression/add-ppc64-fallback-unwinder/runtest.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/add-ppc64-fallback-unwinder +# Description: add-ppc64-fallback-unwinder +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TEMPD=\$(mktemp -d)" + rlRun "cp backtrace.ppc64le.fp.core.bz2 backtrace.ppc64le.fp.exec.bz2 output.ref $TEMPD" + rlRun "pushd $TEMPD" + rlRun "bunzip2 backtrace.ppc64le.fp.core.bz2" + rlRun "bunzip2 backtrace.ppc64le.fp.exec.bz2" + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-stack --exec backtrace.ppc64le.fp.exec --core backtrace.ppc64le.fp.core |& tee output.txt" + rlRun "grep '^#' output.ref > output.ref.filtered" + rlRun "grep '^#' output.txt > output.txt.filtered" + rlRun "diff output.txt.filtered output.ref.filtered" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TEMPD" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/api-break-in-libasm-h/Makefile b/tests/Regression/api-break-in-libasm-h/Makefile new file mode 100644 index 0000000..ea40a57 --- /dev/null +++ b/tests/Regression/api-break-in-libasm-h/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/api-break-in-libasm-h +# Description: api-break-in-libasm-h +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/api-break-in-libasm-h +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE test.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: api-break-in-libasm-h" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils-devel" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1789885" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/api-break-in-libasm-h/PURPOSE b/tests/Regression/api-break-in-libasm-h/PURPOSE new file mode 100644 index 0000000..00cfe40 --- /dev/null +++ b/tests/Regression/api-break-in-libasm-h/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Regression/api-break-in-libasm-h +Description: api-break-in-libasm-h +Author: Martin Cermak diff --git a/tests/Regression/api-break-in-libasm-h/main.fmf b/tests/Regression/api-break-in-libasm-h/main.fmf new file mode 100644 index 0000000..057a742 --- /dev/null +++ b/tests/Regression/api-break-in-libasm-h/main.fmf @@ -0,0 +1,14 @@ +summary: api-break-in-libasm-h +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils-devel +- gcc +duration: 48h +extra-summary: /tools/elfutils/Regression/api-break-in-libasm-h +extra-task: /tools/elfutils/Regression/api-break-in-libasm-h diff --git a/tests/Regression/api-break-in-libasm-h/runtest.sh b/tests/Regression/api-break-in-libasm-h/runtest.sh new file mode 100755 index 0000000..25e19cd --- /dev/null +++ b/tests/Regression/api-break-in-libasm-h/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/api-break-in-libasm-h +# Description: api-break-in-libasm-h +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + rlRun "test -f /usr/include/elfutils/libasm.h" + rlRun "gcc -I/usr/include/elfutils -c test.c" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/api-break-in-libasm-h/test.c b/tests/Regression/api-break-in-libasm-h/test.c new file mode 100644 index 0000000..83a8af0 --- /dev/null +++ b/tests/Regression/api-break-in-libasm-h/test.c @@ -0,0 +1,6 @@ +#include +#include +#include + + + diff --git a/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/Makefile b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/Makefile new file mode 100644 index 0000000..165d96b --- /dev/null +++ b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table +# Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE libantlr.a.bz2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Vaclav Kadlcik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: bzip2" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1059897" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/PURPOSE b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/PURPOSE new file mode 100644 index 0000000..736226e --- /dev/null +++ b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/PURPOSE @@ -0,0 +1,12 @@ +PURPOSE of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table +Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table) +Author: Vaclav Kadlcik +Bug summary: Support 64-bit /SYM64/ symbol table +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1059897 + +Verify that a 64-bit symbol table produced on s390x is readable by elfutils +tools. The test is based on Ed Santiago's examples in Bugzilla; a test file +(libantlr.a) is taken from antlr-C++-2.7.7-30.el7.s390x.rpm. Mark Wielaard +mentioned another test included in the upstream; it gets processed within +../../testsuite (which runs the complete upstream testsuite) so its omission +here is intentional. diff --git a/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/libantlr.a.bz2 b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/libantlr.a.bz2 new file mode 100644 index 0000000..b839b74 Binary files /dev/null and b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/libantlr.a.bz2 differ diff --git a/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/main.fmf b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/main.fmf new file mode 100644 index 0000000..1f1766e --- /dev/null +++ b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/main.fmf @@ -0,0 +1,23 @@ +summary: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table) +description: | + Bug summary: Support 64-bit /SYM64/ symbol table + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1059897 + + Verify that a 64-bit symbol table produced on s390x is readable by elfutils + tools. The test is based on Ed Santiago's examples in Bugzilla; a test file + (libantlr.a) is taken from antlr-C++-2.7.7-30.el7.s390x.rpm. Mark Wielaard + mentioned another test included in the upstream; it gets processed within + ../../testsuite (which runs the complete upstream testsuite) so its omission + here is intentional. +contact: +- Vaclav Kadlcik +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- bzip2 +duration: 5m +extra-summary: /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table +extra-task: /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table diff --git a/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/runtest.sh b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/runtest.sh new file mode 100755 index 0000000..2b35c4c --- /dev/null +++ b/tests/Regression/bz1059897-Support-64-bit-SYM64-symbol-table/runtest.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz1059897-Support-64-bit-SYM64-symbol-table +# Description: Test for BZ#1059897 (Support 64-bit /SYM64/ symbol table) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +TEST_ARCHIVE_1='libantlr.a' # see PURPOSE & Bugzilla + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp ${TEST_ARCHIVE_1}.bz2 $TmpDir" 0 "Copying test files" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + + rlRun "bunzip2 ${TEST_ARCHIVE_1}.bz2" + rlAssertExists "$TEST_ARCHIVE_1" + + rlRun -s "eu-ar t $TEST_ARCHIVE_1" 0 "Checking eu-ar runs" + rlAssertExists "$rlRun_LOG" + rlAssertGrep '^/SYM64/$' "$rlRun_LOG" + rlAssertGrep '^ANTLRUtil\.o$' "$rlRun_LOG" + + rlRun -s "eu-readelf -a $TEST_ARCHIVE_1" 0 "Checking eu-readelf runs" + rlAssertExists "$rlRun_LOG" + rlAssertGrep '^ELF Header:$' "$rlRun_LOG" + + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/Makefile b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/Makefile new file mode 100644 index 0000000..1a21968 --- /dev/null +++ b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore +# Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: gdb" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1371517" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/PURPOSE b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/PURPOSE new file mode 100644 index 0000000..d82ebd0 --- /dev/null +++ b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore +Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore) +Author: Martin Cermak +Bug summary: eu-stack killed by SIGABRT processing gcore created core file +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1371517 diff --git a/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/main.fmf b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/main.fmf new file mode 100644 index 0000000..639d979 --- /dev/null +++ b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore) +description: | + Bug summary: eu-stack killed by SIGABRT processing gcore created core file + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1371517 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- gdb +duration: 48h +extra-summary: /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore +extra-task: /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore diff --git a/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/runtest.sh b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/runtest.sh new file mode 100755 index 0000000..34fbabd --- /dev/null +++ b/tests/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore/runtest.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz1371517-eu-stack-killed-by-SIGABRT-processing-gcore +# Description: Test for BZ#1371517 (eu-stack killed by SIGABRT processing gcore) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "rpm -q elfutils" + rlRun "rpm -q gdb" + rlRun "TMPD=\$(mktemp -d)" + rlRun "pushd $TMPD" + rlPhaseEnd + + rlPhaseStart FAIL "Build an unstripped binary" + # ... so that we don't need to rely on the infra providing us with + # a (coreutils-) debuginfo package. + echo -e "#include \nint main () { sleep(100); return 0; }" | gcc -g -xc -o sleep100 - + rlRun "file sleep100 | fgrep 'not stripped'" + rlPhaseEnd + + rlPhaseStartTest + ./sleep100 & + SLEEP_PID=$! + rlRun "gcore $SLEEP_PID" + # On some arches, such as aarch64, or s390x, eu-stack doesn't end at some + # reasonable point, when printing the trace, and goes across main, to + # __libc_start_main and even higher and then finally complains about + # "no matching address range". But we don't want to be so strict to check + # for this right now. Mark Wielaard says it is okay, so I trust him ... + # Following assert fails when we get SEGV, which would be bz1371517, which + # reproduces e.g. on f25 using elfutils-0.166-2.fc25, or on rhel-7.3 + # using elfutils-0.166-2.el7. + rlRun "eu-stack --executable=./sleep100 --core=core.$SLEEP_PID > output.txt" 0,1 + # Print the output. Yeah, this could be done using tee or something in + # the above line and play games with exitcodes within a pipe chain, but + # this actually is https://en.wikipedia.org/wiki/KISS_principle :) + rlRun "cat output.txt" + # ... we do want to check at least that "main" was listed in the trace. + rlRun "awk {'print \$3'} output.txt | grep ^main$" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TMPD" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1717349-vaguely-related-SEGV/Makefile b/tests/Regression/bz1717349-vaguely-related-SEGV/Makefile new file mode 100644 index 0000000..1246ea1 --- /dev/null +++ b/tests/Regression/bz1717349-vaguely-related-SEGV/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV +# Description: bz1717349-vaguely-related-SEGV +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz1717349-vaguely-related-SEGV +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE qat_c3xxx.ko + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: bz1717349-vaguely-related-SEGV" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1717349" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1717349-vaguely-related-SEGV/PURPOSE b/tests/Regression/bz1717349-vaguely-related-SEGV/PURPOSE new file mode 100644 index 0000000..b1fac9a --- /dev/null +++ b/tests/Regression/bz1717349-vaguely-related-SEGV/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV +Description: bz1717349-vaguely-related-SEGV +Author: Martin Cermak diff --git a/tests/Regression/bz1717349-vaguely-related-SEGV/main.fmf b/tests/Regression/bz1717349-vaguely-related-SEGV/main.fmf new file mode 100644 index 0000000..52eae32 --- /dev/null +++ b/tests/Regression/bz1717349-vaguely-related-SEGV/main.fmf @@ -0,0 +1,13 @@ +summary: bz1717349-vaguely-related-SEGV +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV +extra-task: /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV diff --git a/tests/Regression/bz1717349-vaguely-related-SEGV/qat_c3xxx.ko b/tests/Regression/bz1717349-vaguely-related-SEGV/qat_c3xxx.ko new file mode 100644 index 0000000..c50cd17 Binary files /dev/null and b/tests/Regression/bz1717349-vaguely-related-SEGV/qat_c3xxx.ko differ diff --git a/tests/Regression/bz1717349-vaguely-related-SEGV/runtest.sh b/tests/Regression/bz1717349-vaguely-related-SEGV/runtest.sh new file mode 100755 index 0000000..a0ba81d --- /dev/null +++ b/tests/Regression/bz1717349-vaguely-related-SEGV/runtest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz1717349-vaguely-related-SEGV +# Description: bz1717349-vaguely-related-SEGV +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # This works with base rhel eu-strip, as well as with various SCL versions of it. Convenience :) + rlRun "which eu-strip" + rlRun "rpm -qf `which eu-strip`" + # Test: SEGV is considered a FAIL (reproduces with elfutils-0.176-4.el8), whereas fixed version exists with 0) + rlRun "eu-strip --remove-comment --reloc-debug-sections -f qat_c3xxx.ko.debug qat_c3xxx.ko" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz447416-segfaults/Makefile b/tests/Regression/bz447416-segfaults/Makefile new file mode 100644 index 0000000..5a1dd3a --- /dev/null +++ b/tests/Regression/bz447416-segfaults/Makefile @@ -0,0 +1,66 @@ +# Makefile - bz447416-segfaults - Bugzilla(s) 447416 +# Author: Petr Muller +# Location: /tools/elfutils/Regression/bz447416-segfaults/Makefile + +# Description: Tests various ELFs on various utils, looking for segfaults + +# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + + +TOPLEVEL_NAMESPACE=/tools +PACKAGE_NAME=elfutils +RELATIVE_PATH=Regression/bz447416-segfaults + +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) +export TESTVERSION=1.0 + +BUILT_FILES= + +testcases.tar.gz: + tar cfz testcases.tar.gz binaries/* + +FILES=$(METADATA) runtest.sh Makefile testcases.tar.gz testprog.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + + +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: Petr Muller " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Tests various ELFs on various utils, looking for segfaults" >> $(METADATA) + @echo "Bug: 447416" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA) + @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz447416-segfaults/PURPOSE b/tests/Regression/bz447416-segfaults/PURPOSE new file mode 100644 index 0000000..7e30a38 --- /dev/null +++ b/tests/Regression/bz447416-segfaults/PURPOSE @@ -0,0 +1,10 @@ +Test Name: bz447416-segfaults - Bugzilla(s) 447416 +Author: Petr Muller +Location: /tools/elfutils/Regression/bz447416-segfaults + +Short Description: Tests various ELFs on various utils, looking for segfaults + + +Long Description: + +Tests various ELFs on various utils, looking for segfaults diff --git a/tests/Regression/bz447416-segfaults/main.fmf b/tests/Regression/bz447416-segfaults/main.fmf new file mode 100644 index 0000000..45a58b2 --- /dev/null +++ b/tests/Regression/bz447416-segfaults/main.fmf @@ -0,0 +1,24 @@ +summary: Tests various ELFs on various utils, looking for segfaults +description: | + Test Name: bz447416-segfaults - Bugzilla(s) 447416 + Author: Petr Muller + Location: /tools/elfutils/Regression/bz447416-segfaults + + Short Description: Tests various ELFs on various utils, looking for segfaults + + + Long Description: + + Tests various ELFs on various utils, looking for segfaults +contact: +- Petr Muller +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- elfutils +duration: 20m +extra-summary: /tools/elfutils/Regression/bz447416-segfaults +extra-task: /tools/elfutils/Regression/bz447416-segfaults diff --git a/tests/Regression/bz447416-segfaults/runtest.sh b/tests/Regression/bz447416-segfaults/runtest.sh new file mode 100755 index 0000000..22f3173 --- /dev/null +++ b/tests/Regression/bz447416-segfaults/runtest.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# runtest.sh - bz447416-segfaults - Bugzilla(s) 447416 +# Author: Petr Muller +# Location: /tools/elfutils/Regression/bz447416-segfaults/runtest.sh + +# Description: Tests various ELFs on various utils, looking for segfaults + +# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +test_binary(){ + command="$1" + args="$2" + expected="$3" + comment="$4" + + echo $command >> $TESTED + rlRun "$command $args > /dev/null" $expected "$comment" + excode=$? + if [ $excode -gt 127 ] + then + rlLog "Unusual exit code: $excode" + fi +} + +PACKAGE=elfutils + +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + +rlPhaseStartSetup "Setting up testcases" + tar xfz testcases.tar.gz + rlAssertExists binaries + export TESTED=`mktemp` + export TOBE=`mktemp` + + rlRun "gcc -o binaries/testprog -g testprog.c" + + for file in $(rpm -ql `rpm -qa | grep elfutils` | grep 'bin' | grep -v '\.') + do + NAME=`basename $file` + if [ "$NAME" != "bin" ] + then + basename $file >> $TOBE + fi + done + sort $TOBE -o $TOBE +rlPhaseEnd + +pushd binaries &> /dev/null +for arch in i386 ia64 ppc ppc64 s390 s390x x86_64 +do + rlPhaseStartTest "Testing $arch binary inputs" + if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7 || rlIsRHEL 8 || rlIsRHEL 9 + then + test_binary "eu-elfcmp" "eu-readelf-$arch eu-readelf-$arch" 0 "Testing eu-elfcmp on identical files" + fi + + test_binary "eu-elflint" "eu-readelf-$arch" 0,1 "Testing elflint without --gnu-ld" + test_binary "eu-elflint" "eu-readelf-$arch -q --gnu-ld" 0,1 "Testing elflint with --gnu-ld" + test_binary "eu-nm" "eu-readelf-$arch" 1 "Testing nm" + test_binary "eu-nm" "-D eu-readelf-$arch" 0 "Testing nm -D" + + if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7 || rlIsRHEL 8 || rlIsRHEL 9 + then + test_binary "eu-objdump" "-ds eu-readelf-$arch" 0,1 "Testing objdump -ds" + fi + + options="-A0 -d0 -h0 -I0 -l0 -n0 -r0 -s0 -S0 -V0 -w1" + options="-a0 $options" + + if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7 + then + options="$options -c1 -p0" + fi + + for option in $options + do + opt=${option:0:2} + exp=${option:2} + test_binary "eu-readelf" "$opt eu-readelf-$arch" $exp "Testing readelf $opt" + done + test_binary "eu-size" "eu-readelf-$arch" 0 "Testing eu-size" + if rlIsRHEL 5 || rlIsFedora || rlIsRHEL 6 || rlIsRHEL 7 || rlIsRHEL 8 || rlIsRHEL 9 + then + test_binary "eu-strings" "eu-readelf-$arch" 0 "Testing eu-strings" + fi + test_binary "eu-strip" "eu-readelf-$arch" 0 "Testing eu-strip" + + test_binary "eu-ar" "rcs test.a eu-readelf-$arch" 0 "Testing eu-ar - creating an archive" + test_binary "eu-ar" "pv test.a" 0 "Testing eu-ar - print the list of modules" + test_binary "eu-ar" "tv test.a" 0 "Testing eu-ar - print the file table" + + test_binary "eu-ranlib" "test.a" 0 "Testing eu-ranlib" + + # This test should be done better - eu-make-debug-archive should do real things + test_binary "eu-make-debug-archive" "--kernel test.a" 0,1 "Testing eu-make-debug-archive" + + # This test should be done better - eu-findtextrel should do real things + test_binary "eu-findtextrel" "eu-readelf-$arch" 0,1 "Testing eu-findtextrel" + + test_binary "eu-addr2line" "stderr -A -f -e eu-readelf-$arch" 0 "Testing eu-addr2line" + + rlRun "objcopy --only-keep-debug testprog testprog.debuginfo" + rlRun "eu-strip --strip-debug -o testprog.stripped testprog" + test_binary "eu-unstrip" "-o testprog.restored testprog.stripped testprog.debuginfo" 0 "Testing eu-unstrip" + + rlPhaseEnd +done + +rlPhaseStart FAIL "eu-stack specific asserts (in elfutils since 0.158)" + if grep -q '^eu-stack$' $TOBE + then + test_binary "eu-stack" "-p 1" 0,1 "Testing eu-stack" + fi +rlPhaseEnd + +rlPhaseStart FAIL "eu-elfcompress specific asserts (in elfutils since 0.165)" + # eu-elfcompress + if grep -q '^eu-elfcompress$' $TOBE + then + for i in zlib zlib-gabi gnu zlib-gnu; do + test_binary "eu-elfcompress" "-o testprog.compressed.$i -t $i testprog" 0 "Testing eu-elfcompress ($i)" + rlRun "eu-elfcmp testprog testprog.compressed.$i" + test_binary "eu-elfcompress" "-o testprog.uncompressed -t none testprog" 0 "Testing eu-elfcompress (none)" + rlRun "eu-elfcmp testprog testprog.uncompressed" + done + fi +rlPhaseEnd + +if grep -q '^eu-elfclassify$' $TOBE; then +rlPhaseStart FAIL "Test eu-elfclassify (in elfutils since 0.178)" + for copt in --elf --elf-file --executable --loadable --program --unstripped; do + test_binary "eu-elfclassify" "$copt testprog" 0 "Testing eu-elfclassify $copt" + done + for copt in --core --debug-only --elf-archive --library --linux-kernel-module --shared; do + test_binary "eu-elfclassify" "$copt testprog" 1 "Testing eu-elfclassify $copt" + done +rlPhaseEnd +fi + +if grep -q '^debuginfod$' $TOBE; then +rlPhaseStart FAIL "Test debuginfod (in elfutils since 0.178)" + test_binary debuginfod "--help" 0 "Test debuginfod for a trivial segv" +rlPhaseEnd +fi + +if grep -q '^debuginfod-find$' $TOBE; then +rlPhaseStart FAIL "Test debuginfod-find (in elfutils since 0.178)" + test_binary "debuginfod-find" "--help" 0 "Test debuginfod-find for a trivial segv" +rlPhaseEnd +fi + +popd &> /dev/null + +rlPhaseStartTest "Testing if complete elfutils were tested" + sort -u $TESTED -o $TESTED + for file in `cat $TOBE` + do + rlLog "Checking if $file was tested" + rlAssertGrep $file $TESTED + done +rlPhaseEnd + +rlPhaseStartCleanup + rm -rf binaries $TOBE $TESTED + rm -f test.a testprog testprog.debuginfo testprog.stripped testprog.restored + rlAssertNotExists binaries +rlPhaseEnd + +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz447416-segfaults/testcases.tar.gz b/tests/Regression/bz447416-segfaults/testcases.tar.gz new file mode 100644 index 0000000..a92f8b0 Binary files /dev/null and b/tests/Regression/bz447416-segfaults/testcases.tar.gz differ diff --git a/tests/Regression/bz447416-segfaults/testprog.c b/tests/Regression/bz447416-segfaults/testprog.c new file mode 100644 index 0000000..52fb982 --- /dev/null +++ b/tests/Regression/bz447416-segfaults/testprog.c @@ -0,0 +1,21 @@ +#include +#include + +int addfunc(int a, int b) +{ + return a + b; +} + +int main(int argc, char **argv) +{ + int p, q, res; + + scanf("%i", &p); + scanf("%i", &q); + + res = addfunc(p, q); + + printf("%i\n", res); + + return 0; +} diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/Makefile b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/Makefile new file mode 100644 index 0000000..e299f27 --- /dev/null +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/Makefile @@ -0,0 +1,74 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction +# Description: Tests few cases where elfutils-prelink interaction caused problems manifesting in systemtap +# Author: Petr Muller +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Muller " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Tests few cases where elfutils-prelink interaction caused problems manifesting in systemtap" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "RunFor: systemtap" >> $(METADATA) + @echo "RunFor: prelink" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 652858" >> $(METADATA) + @echo "Requires: gcc-debuginfo" >> $(METADATA) + @echo "Requires: coreutils-debuginfo" >> $(METADATA) + @echo "Requires: findutils-debuginfo" >> $(METADATA) + @echo "Requires: kernel-devel" >> $(METADATA) + @echo "Requires: systemtap" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: yum-utils" >> $(METADATA) + @echo "Architectures: i386 x86_64 ppc ppc64 s390x" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/PURPOSE b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/PURPOSE new file mode 100644 index 0000000..4ec5b41 --- /dev/null +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction +Description: Tests few cases where elfutils-prelink interaction caused problems manifesting in systemtap +Author: Petr Muller diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/main.fmf b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/main.fmf new file mode 100644 index 0000000..99b7823 --- /dev/null +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/main.fmf @@ -0,0 +1,21 @@ +summary: Tests few cases where elfutils-prelink interaction caused problems manifesting + in systemtap +description: '' +contact: +- Petr Muller +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- gcc-debuginfo +- coreutils-debuginfo +- findutils-debuginfo +- kernel-devel +- systemtap +- elfutils +- yum-utils +duration: 20m +extra-summary: /tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction +extra-task: /tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh new file mode 100755 index 0000000..6ccf347 --- /dev/null +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz652858-elfutils-prelink-stap-interaction +# Description: Tests few cases where elfutils-prelink interaction caused problems manifesting in systemtap +# Author: Petr Muller +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/share/beakerlib/beakerlib.sh + +PACKAGE="$( rpm -qf --queryformat='%{name}\n' `which eu-strip` )" + +# work around https://github.com/psss/tmt/issues/624 +dnf debuginfo-install -y coreutils findutils gcc gcc-c++ libstdc++ ||: + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm "coreutils-debuginfo" + rlAssertRpm "findutils-debuginfo" + rlRun "rpm -qa | grep 'gcc-debuginfo'" + + LIBSTDCPP="$( ldd `which stap` | awk '/libstdc++/ {print $3}' )" + + rlRun "touch /var/lib/misc/prelink.force" + test -e /etc/cron.daily/prelink && \ + rlRun "time /etc/cron.daily/prelink" + rlPhaseEnd + + rlPhaseStartTest + rlLog "Running libstdc++ testcase" + # this needs baseos gcc-debuginfo. DTS-systemtap is linked against it as well as baseos systemtap. + # On rhel7 devtoolset-3-gcc-debuginfo collides with gcc-debuginfo (not on rhel6) + stap -e "probe process("'"'"$LIBSTDCPP"'"'').function("operator new") { next }' -c 'stap -V' -v 2>&1 | tee output + rlAssertGrep "System[Tt]ap translator" output + + rlLog "Running /bin/env testcase" + stap -e 'probe process("/bin/env").function("main") { println(pp()) }' -c '/bin/env true' -v | tee output + rlAssertGrep "/bin/env" output + + + rlLog "Running `which find` testcase" + stap -e 'probe process("'"`which find`"'").function("main") { println(pp()) }' -c "`which find` /dev/null" -v | tee output + rlAssertGrep "`which find`" output + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -f output" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/Makefile b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/Makefile new file mode 100644 index 0000000..9d3b9ba --- /dev/null +++ b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted +# Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE ld.bz2 ld.debug.bz2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Vaclav Kadlcik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils bzip2" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 806474" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/PURPOSE b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/PURPOSE new file mode 100644 index 0000000..163e2ce --- /dev/null +++ b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/PURPOSE @@ -0,0 +1,9 @@ +PURPOSE of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted +Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted) +Author: Vaclav Kadlcik +Bug summary: eu-unstrip unwilling to reassembled corrupted separate debuginfo +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=806474 + +Make sure eu-unstrip can merge (when forced) a stripped binary and a separate +debuginfo in spite of the debuginfo was produced by a buggy version of binutils +(see BZ#698005). The test is based on Mark Wielaard's suggestion in Bugzilla. diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.bz2 b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.bz2 new file mode 100755 index 0000000..0a30dfe Binary files /dev/null and b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.bz2 differ diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.debug.bz2 b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.debug.bz2 new file mode 100644 index 0000000..f18e233 Binary files /dev/null and b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/ld.debug.bz2 differ diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/main.fmf b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/main.fmf new file mode 100644 index 0000000..d4f8b8d --- /dev/null +++ b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted) +description: | + Bug summary: eu-unstrip unwilling to reassembled corrupted separate debuginfo + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=806474 + + Make sure eu-unstrip can merge (when forced) a stripped binary and a separate + debuginfo in spite of the debuginfo was produced by a buggy version of binutils + (see BZ#698005). The test is based on Mark Wielaard's suggestion in Bugzilla. +contact: +- Vaclav Kadlcik +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- bzip2 +duration: 5m +extra-summary: /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted +extra-task: /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted diff --git a/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/runtest.sh b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/runtest.sh new file mode 100755 index 0000000..af46602 --- /dev/null +++ b/tests/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted/runtest.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz806474-eu-unstrip-unwilling-to-reassembled-corrupted +# Description: Test for BZ#806474 (eu-unstrip unwilling to reassembled corrupted) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +TEST_STRIPPED='ld' # see PURPOSE, BZ#806474, and 698005 +TEST_DEBUGIFO='ld.debug' # ditto +TEST_MERGED='ld-debug' + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp ${TEST_STRIPPED}.bz2 ${TEST_DEBUGIFO}.bz2 $TmpDir" 0 "Copying test files" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + + rlRun "bunzip2 ${TEST_STRIPPED}.bz2" 0 + rlRun "bunzip2 ${TEST_DEBUGIFO}.bz2" 0 + rlAssertExists "$TEST_STRIPPED" + rlAssertExists "$TEST_DEBUGIFO" + + rlRun -t -s "eu-unstrip -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 1 'unstrip with corrupted debuginfo' + rlAssertNotExists "$TEST_MERGED" + rlAssertGrep '^STDERR:.*ELF header identification.*different, use --force' "$rlRun_LOG" + + rlRun -t -s "eu-unstrip --force -o $TEST_MERGED $TEST_STRIPPED $TEST_DEBUGIFO" 0 'Forced unstrip with corrupted debuginfo' + rlAssertExists "$TEST_MERGED" + rlAssertGrep '^STDERR:.*WARNING:.*ELF header identification.*different' "$rlRun_LOG" + + rlRun -t -s "file $TEST_MERGED" 0 'Detecting type of merged file' + rlAssertGrep '^STDOUT:.*not stripped$' "$rlRun_LOG" + + rlRun -s "eu-objdump -s $TEST_MERGED" 0 'Running objdump on merged file' + rlAssertGrep '^Contents of section .debug_info:' "$rlRun_LOG" + rlAssertGrep '^Contents of section .debug_line:' "$rlRun_LOG" + + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/Makefile b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/Makefile new file mode 100644 index 0000000..7bd3800 --- /dev/null +++ b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line +# Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE a.out + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Dagmar Prokopova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 917874" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/PURPOSE b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/PURPOSE new file mode 100644 index 0000000..1e44cf8 --- /dev/null +++ b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line +Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line) +Author: Dagmar Prokopova +Bug summary: [RHDT] Assertion failure in eu-addr2line +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=917874 diff --git a/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/a.out b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/a.out new file mode 100644 index 0000000..ffdbfc0 Binary files /dev/null and b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/a.out differ diff --git a/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/main.fmf b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/main.fmf new file mode 100644 index 0000000..ca0bd46 --- /dev/null +++ b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/main.fmf @@ -0,0 +1,15 @@ +summary: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line) +description: | + Bug summary: [RHDT] Assertion failure in eu-addr2line + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=917874 +contact: +- Dagmar Prokopova +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 5m +extra-summary: /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line +extra-task: /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line diff --git a/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/runtest.sh b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/runtest.sh new file mode 100755 index 0000000..6b2f0ef --- /dev/null +++ b/tests/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz917874-RHDT-Assertion-failure-in-eu-addr2line +# Description: Test for BZ#917874 ([RHDT] Assertion failure in eu-addr2line) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +# This was fixed in devtoolset-2-elfutils-0.155-6. + +PACKAGES=(elfutils) + +rlJournalStart + rlPhaseStartSetup + for p in "${PACKAGES[@]}"; do + rlAssertRpm "$p" || yum -y install "$p" + done; unset p + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + + # We need the reproducer. + cp -v a.out $TmpDir + + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + # This should succeed without assertion fail. + rlRun "eu-addr2line -e a.out 0x400589" 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/Makefile b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/Makefile new file mode 100644 index 0000000..84db65f --- /dev/null +++ b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines +# Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE vpoolengineUS.bz2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Dagmar Prokopova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils bzip2 gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 927626" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/PURPOSE b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/PURPOSE new file mode 100644 index 0000000..4d5f49a --- /dev/null +++ b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines +Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines) +Author: Dagmar Prokopova +Bug summary: [RHDT] Stack overflow in dwarf_getsrclines +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=927626 diff --git a/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/main.fmf b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/main.fmf new file mode 100644 index 0000000..0246e42 --- /dev/null +++ b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines) +description: | + Bug summary: [RHDT] Stack overflow in dwarf_getsrclines + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=927626 +contact: +- Dagmar Prokopova +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- bzip2 +- gcc +duration: 30m +extra-summary: /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines +extra-task: /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines diff --git a/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/runtest.sh b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/runtest.sh new file mode 100755 index 0000000..aa7df40 --- /dev/null +++ b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines +# Description: Test for BZ#927626 ([RHDT] Stack overflow in dwarf_getsrclines) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +# This was fixed in elfutils-0.155-7. + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + # We need the reproducer. + cp -v vpoolengineUS.bz2 $TmpDir + rlRun "pushd $TmpDir" + rlRun "bunzip2 vpoolengineUS.bz2" + rlPhaseEnd + + rlPhaseStartTest + # No segfault should appear. + rlRun "eu-addr2line -e vpoolengineUS 0x6682f7" 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/vpoolengineUS.bz2 b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/vpoolengineUS.bz2 new file mode 100644 index 0000000..40d8d79 Binary files /dev/null and b/tests/Regression/bz927626-RHDT-Stack-overflow-in-dwarf-getsrclines/vpoolengineUS.bz2 differ diff --git a/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/Makefile b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/Makefile new file mode 100644 index 0000000..1df9bb0 --- /dev/null +++ b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line +# Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE proc_maps.txt + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Dagmar Prokopova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 967130" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/PURPOSE b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/PURPOSE new file mode 100644 index 0000000..bc7a857 --- /dev/null +++ b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line +Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line) +Author: Dagmar Prokopova +Bug summary: [RHDT] eu-unstrip -M abort on socket: line +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=967130 diff --git a/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/main.fmf b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/main.fmf new file mode 100644 index 0000000..2f28d7d --- /dev/null +++ b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/main.fmf @@ -0,0 +1,15 @@ +summary: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line) +description: | + Bug summary: [RHDT] eu-unstrip -M abort on socket: line + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=967130 +contact: +- Dagmar Prokopova +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 5m +extra-summary: /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line +extra-task: /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line diff --git a/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/proc_maps.txt b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/proc_maps.txt new file mode 100644 index 0000000..673a4d6 --- /dev/null +++ b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/proc_maps.txt @@ -0,0 +1,82 @@ +00400000-024aa000 r-xp 00000000 08:02 159659 /opt/MessageRouter/bin/msgrouter_dbg +026aa000-026b2000 rwxp 020aa000 08:02 159659 /opt/MessageRouter/bin/msgrouter_dbg +026b2000-026bf000 rwxp 00000000 00:00 0 +0335a000-03e6f000 rwxp 00000000 00:00 0 [heap] +2b7b2d6fa000-2b7b2d71a000 r-xp 00000000 08:02 128802 /lib64/ld-2.12.so +2b7b2d71a000-2b7b2d89c000 rwxp 00000000 00:00 0 +2b7b2d919000-2b7b2d91a000 r-xp 0001f000 08:02 128802 /lib64/ld-2.12.so +2b7b2d91a000-2b7b2d91b000 rwxp 00020000 08:02 128802 /lib64/ld-2.12.so +2b7b2d91b000-2b7b2d91c000 rwxp 00000000 00:00 0 +2b7b2d91c000-2b7b2d933000 r-xp 00000000 08:02 128833 /lib64/libpthread-2.12.so +2b7b2d933000-2b7b2db32000 ---p 00017000 08:02 128833 /lib64/libpthread-2.12.so +2b7b2db32000-2b7b2db33000 r-xp 00016000 08:02 128833 /lib64/libpthread-2.12.so +2b7b2db33000-2b7b2db34000 rwxp 00017000 08:02 128833 /lib64/libpthread-2.12.so +2b7b2db34000-2b7b2db39000 rwxp 00000000 00:00 0 +2b7b2db39000-2b7b2db40000 r-xp 00000000 08:02 128837 /lib64/librt-2.12.so +2b7b2db40000-2b7b2dd3f000 ---p 00007000 08:02 128837 /lib64/librt-2.12.so +2b7b2dd3f000-2b7b2dd40000 r-xp 00006000 08:02 128837 /lib64/librt-2.12.so +2b7b2dd40000-2b7b2dd41000 rwxp 00007000 08:02 128837 /lib64/librt-2.12.so +2b7b2dd41000-2b7b2dd43000 r-xp 00000000 08:02 128815 /lib64/libdl-2.12.so +2b7b2dd43000-2b7b2df43000 ---p 00002000 08:02 128815 /lib64/libdl-2.12.so +2b7b2df43000-2b7b2df44000 r-xp 00002000 08:02 128815 /lib64/libdl-2.12.so +2b7b2df44000-2b7b2df45000 rwxp 00003000 08:02 128815 /lib64/libdl-2.12.so +2b7b2df45000-2b7b2e032000 r-xp 00000000 08:02 276647 /usr/lib64/libboost_regex.so.5 +2b7b2e032000-2b7b2e232000 ---p 000ed000 08:02 276647 /usr/lib64/libboost_regex.so.5 +2b7b2e232000-2b7b2e239000 rwxp 000ed000 08:02 276647 /usr/lib64/libboost_regex.so.5 +2b7b2e239000-2b7b2e23a000 rwxp 00000000 00:00 0 +2b7b2e23a000-2b7b2e322000 r-xp 00000000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13 +2b7b2e322000-2b7b2e522000 ---p 000e8000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13 +2b7b2e522000-2b7b2e529000 r-xp 000e8000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13 +2b7b2e529000-2b7b2e52b000 rwxp 000ef000 08:02 260385 /usr/lib64/libstdc++.so.6.0.13 +2b7b2e52b000-2b7b2e540000 rwxp 00000000 00:00 0 +2b7b2e540000-2b7b2e5c3000 r-xp 00000000 08:02 128817 /lib64/libm-2.12.so +2b7b2e5c3000-2b7b2e7c2000 ---p 00083000 08:02 128817 /lib64/libm-2.12.so +2b7b2e7c2000-2b7b2e7c3000 r-xp 00082000 08:02 128817 /lib64/libm-2.12.so +2b7b2e7c3000-2b7b2e7c4000 rwxp 00083000 08:02 128817 /lib64/libm-2.12.so +2b7b2e7c4000-2b7b2e7da000 r-xp 00000000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1 +2b7b2e7da000-2b7b2e9d9000 ---p 00016000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1 +2b7b2e9d9000-2b7b2e9da000 rwxp 00015000 08:02 136724 /lib64/libgcc_s-4.4.6-20110824.so.1 +2b7b2e9da000-2b7b2e9db000 rwxp 00000000 00:00 0 +2b7b2e9db000-2b7b2eb72000 r-xp 00000000 08:02 128809 /lib64/libc-2.12.so +2b7b2eb72000-2b7b2ed72000 ---p 00197000 08:02 128809 /lib64/libc-2.12.so +2b7b2ed72000-2b7b2ed76000 r-xp 00197000 08:02 128809 /lib64/libc-2.12.so +2b7b2ed76000-2b7b2ed77000 rwxp 0019b000 08:02 128809 /lib64/libc-2.12.so +2b7b2ed77000-2b7b2ed7c000 rwxp 00000000 00:00 0 +2b7b2ed7c000-2b7b2eebb000 r-xp 00000000 08:02 276645 /usr/lib64/libicuuc.so.42.1 +2b7b2eebb000-2b7b2f0bb000 ---p 0013f000 08:02 276645 /usr/lib64/libicuuc.so.42.1 +2b7b2f0bb000-2b7b2f0cc000 rwxp 0013f000 08:02 276645 /usr/lib64/libicuuc.so.42.1 +2b7b2f0cc000-2b7b2f0ce000 rwxp 00000000 00:00 0 +2b7b2f0ce000-2b7b2f256000 r-xp 00000000 08:02 276635 /usr/lib64/libicui18n.so.42.1 +2b7b2f256000-2b7b2f456000 ---p 00188000 08:02 276635 /usr/lib64/libicui18n.so.42.1 +2b7b2f456000-2b7b2f463000 rwxp 00188000 08:02 276635 /usr/lib64/libicui18n.so.42.1 +2b7b2f463000-2b7b2f465000 rwxp 00000000 00:00 0 +2b7b2f465000-2b7b303aa000 r-xp 00000000 08:02 276633 /usr/lib64/libicudata.so.42.1 +2b7b303aa000-2b7b305a9000 ---p 00f45000 08:02 276633 /usr/lib64/libicudata.so.42.1 +2b7b305a9000-2b7b305aa000 rwxp 00f44000 08:02 276633 /usr/lib64/libicudata.so.42.1 +2b7b305aa000-2b7b313f5000 rwxp 00000000 00:00 0 +2b7b313f5000-2b7b313f6000 ---p 00000000 00:00 0 +2b7b313f6000-2b7b31df6000 rwxp 00000000 00:00 0 +2b7b31df6000-2b7b31df7000 ---p 00000000 00:00 0 +2b7b31df7000-2b7b327f7000 rwxp 00000000 00:00 0 +2b7b34000000-2b7b34021000 rwxp 00000000 00:00 0 +2b7b34021000-2b7b38000000 ---p 00000000 00:00 0 +2b7b38000000-2b7b38282000 rwxp 00000000 00:00 0 +2b7b38282000-2b7b38302000 rwxs 00000000 00:06 493872 socket:[493872] +2b7b38302000-2b7b38312000 rwxs 00000000 00:06 493872 socket:[493872] +2b7b38312000-2b7b38b12000 r-xs 00000000 00:06 493872 socket:[493872] +2b7b38b12000-2b7b38b22000 rwxs 00000000 00:06 493872 socket:[493872] +2b7b38b22000-2b7b39322000 rwxs 00000000 00:06 493872 socket:[493872] +2b7b39322000-2b7b39323000 ---p 00000000 00:00 0 +2b7b39323000-2b7b39d23000 rwxp 00000000 00:00 0 +2b7b3c000000-2b7b3c021000 rwxp 00000000 00:00 0 +2b7b3c021000-2b7b40000000 ---p 00000000 00:00 0 +2b7b40000000-2b7b40021000 rwxp 00000000 00:00 0 +2b7b40021000-2b7b44000000 ---p 00000000 00:00 0 +2b7b44010000-2b7b4401c000 r-xp 00000000 08:02 128825 /lib64/libnss_files-2.12.so +2b7b4401c000-2b7b4421c000 ---p 0000c000 08:02 128825 /lib64/libnss_files-2.12.so +2b7b4421c000-2b7b4421d000 r-xp 0000c000 08:02 128825 /lib64/libnss_files-2.12.so +2b7b4421d000-2b7b4421e000 rwxp 0000d000 08:02 128825 /lib64/libnss_files-2.12.so +2b7b4439f000-2b7b45ea1000 rwxp 00000000 00:00 0 +7fff26cf7000-7fff26d0c000 rwxp 00000000 00:00 0 [stack] +7fff26dff000-7fff26e00000 r-xp 00000000 00:00 0 [vdso] +ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] diff --git a/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/runtest.sh b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/runtest.sh new file mode 100755 index 0000000..e541b6b --- /dev/null +++ b/tests/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line/runtest.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/bz967130-RHDT-eu-unstrip-M-abort-on-socket-line +# Description: Test for BZ#967130 ([RHDT] eu-unstrip -M abort on socket line) +# Author: Dagmar Prokopova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + # We need a reproducer. + cp -v proc_maps.txt $TmpDir + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + #No Abort here. + rlRun "eu-unstrip -n -M proc_maps.txt " 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/Makefile b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/Makefile new file mode 100644 index 0000000..87d1e51 --- /dev/null +++ b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed +# Description: elfutils-default-yama-scope-scriptlet-failed +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: elfutils-default-yama-scope-scriptlet-failed" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils-default-yama-scope" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1509861" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/PURPOSE b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/PURPOSE new file mode 100644 index 0000000..ef39591 --- /dev/null +++ b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed +Description: elfutils-default-yama-scope-scriptlet-failed +Author: Martin Cermak +Bug summary: warning: %post(elfutils-default-yama-scope-0.170-2.el7.noarch) scriptlet failed, exit status 127 +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1509861 diff --git a/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/main.fmf b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/main.fmf new file mode 100644 index 0000000..448159d --- /dev/null +++ b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/main.fmf @@ -0,0 +1,15 @@ +summary: elfutils-default-yama-scope-scriptlet-failed +description: | + Bug summary: warning: %post(elfutils-default-yama-scope-0.170-2.el7.noarch) scriptlet failed, exit status 127 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1509861 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils-default-yama-scope +duration: 48h +extra-summary: /tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed +extra-task: /tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed diff --git a/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/runtest.sh b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/runtest.sh new file mode 100755 index 0000000..f2c22f6 --- /dev/null +++ b/tests/Regression/elfutils-default-yama-scope-scriptlet-failed/runtest.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/elfutils-default-yama-scope-scriptlet-failed +# Description: elfutils-default-yama-scope-scriptlet-failed +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + if rlIsRHEL 6; then + rlLogInfo "RHEL6: Irrelevant env." + else + rlRun "grep 'warning.*elfutils-default-yama-scope' /var/log/anaconda/packaging.log" 1 + fi + # The above record gets generated by anaconda. The ability of this test to + # catch the bug depends on how it is run. + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/Makefile b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/Makefile new file mode 100644 index 0000000..a5a2b7f --- /dev/null +++ b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in +# Description: elfutils-segmentation-fault-in-elf64-xlatetom-in +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: elfutils-segmentation-fault-in-elf64-xlatetom-in" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1680048" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/POC2 b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/POC2 new file mode 100644 index 0000000..0c1a4d0 Binary files /dev/null and b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/POC2 differ diff --git a/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/PURPOSE b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/PURPOSE new file mode 100644 index 0000000..867dfd8 --- /dev/null +++ b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in +Description: elfutils-segmentation-fault-in-elf64-xlatetom-in +Author: Martin Cermak +Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhdts-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680048 diff --git a/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/main.fmf b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/main.fmf new file mode 100644 index 0000000..c487d28 --- /dev/null +++ b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/main.fmf @@ -0,0 +1,15 @@ +summary: elfutils-segmentation-fault-in-elf64-xlatetom-in +description: | + Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhdts-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680048 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in +extra-task: /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in diff --git a/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/runtest.sh b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/runtest.sh new file mode 100755 index 0000000..2287722 --- /dev/null +++ b/tests/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/elfutils-segmentation-fault-in-elf64-xlatetom-in +# Description: elfutils-segmentation-fault-in-elf64-xlatetom-in +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # failure is 139 - SEGV, 2 is okay + rlRun "eu-stack --core=POC2" 2 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/eu-readelf-reports-machine-type-is-unknown/Makefile b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/Makefile new file mode 100644 index 0000000..2f5488f --- /dev/null +++ b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown +# Description: Test for BZ#1724350 (eu-readelf reports machine type is ) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1724350 (eu-readelf reports machine type is )" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils linux-firmware" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1724350" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/eu-readelf-reports-machine-type-is-unknown/PURPOSE b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/PURPOSE new file mode 100644 index 0000000..49ffd25 --- /dev/null +++ b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown +Description: Test for BZ#1724350 (eu-readelf reports machine type is ) +Author: Martin Cermak +Bug summary: eu-readelf reports machine type is on firmware blobs +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1724350 diff --git a/tests/Regression/eu-readelf-reports-machine-type-is-unknown/main.fmf b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/main.fmf new file mode 100644 index 0000000..c9a9d41 --- /dev/null +++ b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1724350 (eu-readelf reports machine type is ) +description: | + Bug summary: eu-readelf reports machine type is on firmware blobs + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1724350 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- linux-firmware +duration: 48h +extra-summary: /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown +extra-task: /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown diff --git a/tests/Regression/eu-readelf-reports-machine-type-is-unknown/runtest.sh b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/runtest.sh new file mode 100755 index 0000000..8558153 --- /dev/null +++ b/tests/Regression/eu-readelf-reports-machine-type-is-unknown/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/eu-readelf-reports-machine-type-is-unknown +# Description: Test for BZ#1724350 (eu-readelf reports machine type is ) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +__showgreenlight () +{ + rlJournalStart + rlPhaseStartTest + rlRun "echo \"Irrelevant for $X_SCLS\"" + rlPhaseEnd + rlJournalEnd + exit 0 +} + +echo $X_SCLS | fgrep -q gcc-toolset-9 && __showgreenlight + +rlJournalStart + rlPhaseStartTest + rlRun "find /usr/lib/firmware/ -name '*.nffw' | xargs eu-readelf -h | awk '/Machine/ {print \$NF}' | fgrep ''" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/eu-strip-generates-empty-output-if/Makefile b/tests/Regression/eu-strip-generates-empty-output-if/Makefile new file mode 100644 index 0000000..9da23ec --- /dev/null +++ b/tests/Regression/eu-strip-generates-empty-output-if/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/eu-strip-generates-empty-output-if +# Description: eu-strip-generates-empty-output-if +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/eu-strip-generates-empty-output-if +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: eu-strip-generates-empty-output-if" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1455620" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/eu-strip-generates-empty-output-if/PURPOSE b/tests/Regression/eu-strip-generates-empty-output-if/PURPOSE new file mode 100644 index 0000000..f32e5fd --- /dev/null +++ b/tests/Regression/eu-strip-generates-empty-output-if/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/eu-strip-generates-empty-output-if +Description: eu-strip-generates-empty-output-if +Author: Martin Cermak +Bug summary: eu-strip generates empty output if there is nothing to do +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455620 diff --git a/tests/Regression/eu-strip-generates-empty-output-if/main.fmf b/tests/Regression/eu-strip-generates-empty-output-if/main.fmf new file mode 100644 index 0000000..9d9ebbf --- /dev/null +++ b/tests/Regression/eu-strip-generates-empty-output-if/main.fmf @@ -0,0 +1,15 @@ +summary: eu-strip-generates-empty-output-if +description: | + Bug summary: eu-strip generates empty output if there is nothing to do + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455620 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/eu-strip-generates-empty-output-if +extra-task: /tools/elfutils/Regression/eu-strip-generates-empty-output-if diff --git a/tests/Regression/eu-strip-generates-empty-output-if/runtest.sh b/tests/Regression/eu-strip-generates-empty-output-if/runtest.sh new file mode 100755 index 0000000..e83d754 --- /dev/null +++ b/tests/Regression/eu-strip-generates-empty-output-if/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/eu-strip-generates-empty-output-if +# Description: eu-strip-generates-empty-output-if +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "tmp=\$(mktemp -d)" + rlRun "pushd $tmp" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo 'int main() { return 1; }' > test.c" + rlRun "gcc test.c" + rlRun "eu-strip -g -o test ./a.out" + rlRun "test $(stat --format='%s' test) -gt 0" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/Makefile b/tests/Regression/eu-strip-invalid-section-alignment-while/Makefile new file mode 100644 index 0000000..9599103 --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +# Description: eu-strip-invalid-section-alignment-while +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE testprog.c testprog2.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: eu-strip-invalid-section-alignment-while" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: libaio-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1303845" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/PURPOSE b/tests/Regression/eu-strip-invalid-section-alignment-while/PURPOSE new file mode 100644 index 0000000..ee925cc --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +Description: eu-strip-invalid-section-alignment-while +Author: Martin Cermak +Bug summary: eu-strip: invalid section alignment while stripping debuginfo from executables +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1303845 diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/main.fmf b/tests/Regression/eu-strip-invalid-section-alignment-while/main.fmf new file mode 100644 index 0000000..954c1c5 --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/main.fmf @@ -0,0 +1,17 @@ +summary: eu-strip-invalid-section-alignment-while +description: | + Bug summary: eu-strip: invalid section alignment while stripping debuginfo from executables + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1303845 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- gcc +- libaio-devel +duration: 5m +extra-summary: /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +extra-task: /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/runtest.sh b/tests/Regression/eu-strip-invalid-section-alignment-while/runtest.sh new file mode 100755 index 0000000..3c19f91 --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/runtest.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +# Description: eu-strip-invalid-section-alignment-while +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartSetup + for p in gcc eu-strip; do + rlRun "which $p" + rlRun "rpm -qf $( which $p )" + done + rlRun "tmp=$(mktemp -d)" + rlRun "cp testprog.c testprog2.c $tmp" + rlRun "pushd $tmp" + rlPhaseEnd + + if rpm -q libaio-devel; then + rlPhaseStart FAIL customer-testcase + # https://bugzilla.redhat.com/show_bug.cgi?id=1304870 + rlRun "gcc testprog.c -laio -g -o testprog" + rlRun "eu-strip testprog" + rlPhaseEnd + fi + + rlPhaseStart FAIL upstream-testcase + rlRun "gcc -g testprog2.c -o testprog2" + # Testcase for this fix should at some point reach the upstream and + # the rhel package too. After that this QE testcase should be obsoleted. + # Please, refer to: + # https://lists.fedorahosted.org/archives/list/elfutils-devel@lists.fedorahosted.org/message/OP6AXOW5PF6GPB4KN7XQZSZ5JY6RK52U/ + rlRun "eu-strip testprog2" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/testinfo.desc b/tests/Regression/eu-strip-invalid-section-alignment-while/testinfo.desc new file mode 100644 index 0000000..1aae73b --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/testinfo.desc @@ -0,0 +1,16 @@ +Owner: Martin Cermak +Name: /tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +TestVersion: 1.0 +Path: /mnt/tests/tools/elfutils/Regression/eu-strip-invalid-section-alignment-while +Description: eu-strip-invalid-section-alignment-while +Type: Regression +TestTime: 1d +RunFor: elfutils +Requires: elfutils +Requires: gcc +Requires: libaio-devel +Priority: Normal +License: GPLv2+ +Confidential: no +Destructive: no +Bug: 1303845 diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/testprog.c b/tests/Regression/eu-strip-invalid-section-alignment-while/testprog.c new file mode 100644 index 0000000..23debb7 --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/testprog.c @@ -0,0 +1,115 @@ +/* + * aio-dio-subblock-eof-read - test AIO read of last block of DIO file + * Copyright (C) 2005 Jeff Moyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Code taken from an example posted to linux-aio at kvack.org + * http://marc.info/?l=linux-aio&m=112263621431161&w=2 + * Original Author: Drangon Zhou + * Munged & rewritten by Jeff Moyer. + * + * Description: This source code implements a test to ensure that an AIO + * read of the last block in a file opened with O_DIRECT returns the proper + * amount of data. In the past, there was a bug that resulted in a return + * value of the requested block size, when in fact there was only a fraction + * of that data available. Thus, if the last data block contained 300 bytes + * worth of data, and the user issued a 4k read, we want to ensure that + * the return value is 300, not 4k. + */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +/* Create a file of a size that is not a multiple of block size */ +#define FILE_SIZE 300 + +#define fail(fmt , args...) \ +do {\ +printf(fmt , ##args);\ +exit(1);\ +} while (0) + +static unsigned char buffer[4096] __attribute((aligned (4096))); + +int +main(int argc, char **argv) +{ +int ret; +int fd; +const char *filename; +struct iocb myiocb; +struct iocb *cb = &myiocb; +io_context_t ioctx; +struct io_event ie; + +if (argc != 2) +fail("only arg should be file name"); + +filename = argv[1]; +fd = open(filename, O_CREAT|O_RDWR|O_DIRECT, 0600); +if (fd < 0) +fail("open returned error %d\n", errno); + +ret = ftruncate(fd, FILE_SIZE); +if (ret < 0) +fail("truncate returned error %d\n", errno); + +/* <1> use normal disk read, this should be ok */ +ret = read(fd, buffer, 4096); +if (ret != FILE_SIZE) +fail("buffered read returned %d, should be 300\n", ret); + +/* <2> use AIO disk read, it sees error. */ +memset(&myiocb, 0, sizeof(myiocb)); +cb->data = 0; +cb->key = 0; +cb->aio_lio_opcode = IO_CMD_PREAD; +cb->aio_reqprio = 0; +cb->aio_fildes = fd; +cb->u.c.buf = buffer; +cb->u.c.nbytes = 4096; +cb->u.c.offset = 0; + +ret = io_queue_init(1, &ioctx); +if (ret != 0) +fail("io_queue_init returned error %d\n", ret); + +ret = io_submit(ioctx, 1, &cb); +if (ret != 1) +fail("io_submit returned error %d\n", ret); + +ret = io_getevents(ioctx, 1, 1, &ie, NULL); +if (ret != 1) +fail("io_getevents returned %d\n", ret); + +/* + * If all goes well, we should see 300 bytes read. If things + * are broken, we may very well see a result of 4k. + */ +if (ie.res != FILE_SIZE) +fail("AIO read of last block in file returned %ld bytes, " + "expected %d\n", ie.res, FILE_SIZE); + +printf("AIO read of last block in file succeeded.\n"); +return 0; +} + diff --git a/tests/Regression/eu-strip-invalid-section-alignment-while/testprog2.c b/tests/Regression/eu-strip-invalid-section-alignment-while/testprog2.c new file mode 100644 index 0000000..60f8573 --- /dev/null +++ b/tests/Regression/eu-strip-invalid-section-alignment-while/testprog2.c @@ -0,0 +1,12 @@ +static unsigned char buffer[4096] __attribute((aligned (4096))); +char +f (int i) +{ + return buffer[i]; +} + +int +main (int argc, char **argv) +{ + return buffer[argc] == 0; +} diff --git a/tests/Regression/initial-DWARF5-support-in-eu-readelf/Makefile b/tests/Regression/initial-DWARF5-support-in-eu-readelf/Makefile new file mode 100644 index 0000000..f6daf76 --- /dev/null +++ b/tests/Regression/initial-DWARF5-support-in-eu-readelf/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf +# Description: initial-DWARF5-support-in-eu-readelf +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE test3-clang.o + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: initial-DWARF5-support-in-eu-readelf" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1472979" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/initial-DWARF5-support-in-eu-readelf/PURPOSE b/tests/Regression/initial-DWARF5-support-in-eu-readelf/PURPOSE new file mode 100644 index 0000000..55b9eff --- /dev/null +++ b/tests/Regression/initial-DWARF5-support-in-eu-readelf/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf +Description: initial-DWARF5-support-in-eu-readelf +Author: Martin Cermak +Bug summary: DWARF5 support in eu-readelf +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1472979 diff --git a/tests/Regression/initial-DWARF5-support-in-eu-readelf/main.fmf b/tests/Regression/initial-DWARF5-support-in-eu-readelf/main.fmf new file mode 100644 index 0000000..2d62363 --- /dev/null +++ b/tests/Regression/initial-DWARF5-support-in-eu-readelf/main.fmf @@ -0,0 +1,15 @@ +summary: initial-DWARF5-support-in-eu-readelf +description: | + Bug summary: DWARF5 support in eu-readelf + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1472979 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf +extra-task: /tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf diff --git a/tests/Regression/initial-DWARF5-support-in-eu-readelf/runtest.sh b/tests/Regression/initial-DWARF5-support-in-eu-readelf/runtest.sh new file mode 100755 index 0000000..e99cdeb --- /dev/null +++ b/tests/Regression/initial-DWARF5-support-in-eu-readelf/runtest.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/initial-DWARF5-support-in-eu-readelf +# Description: initial-DWARF5-support-in-eu-readelf +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartTest + rlRun "eu-readelf --debug-dump=info test3-clang.o | fgrep '???'" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/initial-DWARF5-support-in-eu-readelf/test3-clang.o b/tests/Regression/initial-DWARF5-support-in-eu-readelf/test3-clang.o new file mode 100644 index 0000000..67f6571 Binary files /dev/null and b/tests/Regression/initial-DWARF5-support-in-eu-readelf/test3-clang.o differ diff --git a/tests/Regression/require-compression-libraries/Makefile b/tests/Regression/require-compression-libraries/Makefile new file mode 100644 index 0000000..b811cc5 --- /dev/null +++ b/tests/Regression/require-compression-libraries/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/require-compression-libraries +# Description: require-compression-libraries +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/require-compression-libraries +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE t.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: require-compression-libraries" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1873413" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/require-compression-libraries/PURPOSE b/tests/Regression/require-compression-libraries/PURPOSE new file mode 100644 index 0000000..c9a8bad --- /dev/null +++ b/tests/Regression/require-compression-libraries/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/require-compression-libraries +Description: require-compression-libraries +Author: Martin Cermak +Bug summary: gcc-toolset-10-elfutils-devel doesn't have Requires and/or links against all supported compression libraries for libdw +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1873413 diff --git a/tests/Regression/require-compression-libraries/main.fmf b/tests/Regression/require-compression-libraries/main.fmf new file mode 100644 index 0000000..c75776e --- /dev/null +++ b/tests/Regression/require-compression-libraries/main.fmf @@ -0,0 +1,16 @@ +summary: require-compression-libraries +description: | + Bug summary: gcc-toolset-10-elfutils-devel doesn't have Requires and/or links against all supported compression libraries for libdw + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1873413 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- gcc +duration: 48h +extra-summary: /tools/elfutils/Regression/require-compression-libraries +extra-task: /tools/elfutils/Regression/require-compression-libraries diff --git a/tests/Regression/require-compression-libraries/runtest.sh b/tests/Regression/require-compression-libraries/runtest.sh new file mode 100755 index 0000000..ecba5e0 --- /dev/null +++ b/tests/Regression/require-compression-libraries/runtest.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/require-compression-libraries +# Description: require-compression-libraries +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + rlRun "gcc -o t t.c -ldw" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/require-compression-libraries/t.c b/tests/Regression/require-compression-libraries/t.c new file mode 100644 index 0000000..3fa93f7 --- /dev/null +++ b/tests/Regression/require-compression-libraries/t.c @@ -0,0 +1,5 @@ +#include + +int main () { dwelf_elf_begin (0); } + + diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/Makefile b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/Makefile new file mode 100644 index 0000000..9bd07f3 --- /dev/null +++ b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data +# Description: Test for BZ#1593328 (Robustify elfutils 0.172 against bad DWARF5 data) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE crashes + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1593328 (Robustify elfutils 0.172 against bad DWARF5 data)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1593328" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/PURPOSE b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/PURPOSE new file mode 100644 index 0000000..b90ff34 --- /dev/null +++ b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data +Description: Test for BZ#1593328 (Robustify elfutils 0.172 against bad DWARF5 data) +Author: Martin Cermak +Bug summary: Robustify elfutils 0.172 against bad DWARF5 data +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1593328 diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_001936,op_flip1,pos_1100 b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_001936,op_flip1,pos_1100 new file mode 100644 index 0000000..79d7fe8 Binary files /dev/null and b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_001936,op_flip1,pos_1100 differ diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_002816,op_int16,pos_370,val_+1024 b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_002816,op_int16,pos_370,val_+1024 new file mode 100644 index 0000000..39a9b32 Binary files /dev/null and b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000001,sig_11,src_002816,op_int16,pos_370,val_+1024 differ diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000002,src_001890,op_flip4,pos_371 b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000002,src_001890,op_flip4,pos_371 new file mode 100644 index 0000000..5e82aca Binary files /dev/null and b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000002,src_001890,op_flip4,pos_371 differ diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000006,src_001890,op_arith8,pos_371,val_+14 b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000006,src_001890,op_arith8,pos_371,val_+14 new file mode 100644 index 0000000..46abd16 Binary files /dev/null and b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000006,src_001890,op_arith8,pos_371,val_+14 differ diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000011,src_001899,op_flip1,pos_371 b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000011,src_001899,op_flip1,pos_371 new file mode 100644 index 0000000..35099b4 Binary files /dev/null and b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/crashes/id_000011,src_001899,op_flip1,pos_371 differ diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/main.fmf b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/main.fmf new file mode 100644 index 0000000..127b3e1 --- /dev/null +++ b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/main.fmf @@ -0,0 +1,15 @@ +summary: Test for BZ#1593328 (Robustify elfutils 0.172 against bad DWARF5 data) +description: | + Bug summary: Robustify elfutils 0.172 against bad DWARF5 data + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1593328 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data +extra-task: /tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data diff --git a/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/runtest.sh b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/runtest.sh new file mode 100755 index 0000000..85254eb --- /dev/null +++ b/tests/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data/runtest.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/robustify-elfutils-0-172-against-bad-DWARF5-data +# Description: Test for BZ#1593328 (Robustify elfutils 0.172 against bad DWARF5 data) +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +_sections="abbrev addr aranges decodedaranges frame gdb_index info info+ loc \ +line decodedline ranges pubnames str macinfo macro exception" + +rlJournalStart + rlPhaseStartTest + for _data in crashes/*; do + for _section in $_sections; do + # 0 and 1 are expected exitcodes: + rlRun "timeout 7 eu-readelf --debug-dump=$_section $_data >/dev/null" 0,1 + done + done + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/rpmtests/Makefile b/tests/Regression/rpmtests/Makefile new file mode 100644 index 0000000..fe7776d --- /dev/null +++ b/tests/Regression/rpmtests/Makefile @@ -0,0 +1,70 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/rpmtests +# Description: runs relevant parts of the RPM testsuite +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/rpmtests +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +requires = audit-libs-devel automake binutils-devel bzip2-devel dbus-devel \ +elfutils-devel elfutils-libelf-devel file-devel gawk gcc gettext-devel \ +ima-evm-utils-devel libacl-devel libarchive-devel libcap-devel libdb-devel \ +libselinux-devel libtool lua-devel make ncurses-devel openssl-devel popt-devel \ +python3-devel readline-devel redhat-rpm-config xz-devel zlib-devel rpm-build \ + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: runs relevant parts of the RPM testsuite" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + $(foreach package, $(requires), echo "Requires: $(package)" >> $(METADATA);) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6 -RHEL7 -RedHatEnterpriseLinuxAlternateArchitectures7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/rpmtests/PURPOSE b/tests/Regression/rpmtests/PURPOSE new file mode 100644 index 0000000..7821836 --- /dev/null +++ b/tests/Regression/rpmtests/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Regression/rpmtests +Description: runs relevant parts of the RPM testsuite +Author: Martin Cermak diff --git a/tests/Regression/rpmtests/main.fmf b/tests/Regression/rpmtests/main.fmf new file mode 100644 index 0000000..3774c68 --- /dev/null +++ b/tests/Regression/rpmtests/main.fmf @@ -0,0 +1,41 @@ +summary: runs relevant parts of the RPM testsuite +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- audit-libs-devel +- automake +- binutils-devel +- bzip2-devel +- dbus-devel +- elfutils-devel +- elfutils-libelf-devel +- file-devel +- gawk +- gcc +- gettext-devel +- ima-evm-utils-devel +- libacl-devel +- libarchive-devel +- libcap-devel +- libdb-devel +- libselinux-devel +- libtool +- lua-devel +- make +- ncurses-devel +- openssl-devel +- popt-devel +- python3-devel +- readline-devel +- redhat-rpm-config +- xz-devel +- zlib-devel +- rpm-build +duration: 48h +extra-summary: /tools/elfutils/Regression/rpmtests +extra-task: /tools/elfutils/Regression/rpmtests diff --git a/tests/Regression/rpmtests/runtest.sh b/tests/Regression/rpmtests/runtest.sh new file mode 100755 index 0000000..88fcae8 --- /dev/null +++ b/tests/Regression/rpmtests/runtest.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/rpmtests +# Description: runs relevant parts of the RPM testsuite +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "TMP=$(mktemp -d)" + rlRun "pushd $TMP" + + rlAssertRpm rpm + rlFetchSrcForInstalled rpm + # Deps involve rpmbuild and other stuff coming from the buildroot compose: + rlRun "dnf builddep --allowerasing --nobest -y *src.rpm" + rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm" + + # See what toolchain do we use + rlRun "which gcc as" + + # RPM fails to build with gcc-toolset-10-gcc + # https://gcc.gnu.org/gcc-10/porting_to.html#common + # Work it around: + if echo $X_SCLS | fgrep gcc-toolset-10; then + sed -i 's/^CFLAGS="\(.*\)"/CFLAGS="\1 -fcommon"/' SPECS/rpm.spec + rlRun "fgrep CFLAGS SPECS/rpm.spec" + fi + + rlRun "PYTHON=python3 rpmbuild --define='_topdir $TMP' -bc SPECS/rpm.spec" + rlRun "pushd BUILD/rpm-*" + rlPhaseEnd + + rlPhaseStartTest + # make check calls ./rpmtests which provides useful --help . + # TESTSUITEFLAGS is a way to pass arguments to it through make + rlRun "TESTSUITEFLAGS='-k debuginfo' make check" + rlRun "TESTSUITEFLAGS='-k buildid' make check" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd; popd" + rlRun "rm -r $TMP" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/static-relocations-not-known-to-older-linkers/Makefile b/tests/Regression/static-relocations-not-known-to-older-linkers/Makefile new file mode 100644 index 0000000..b91bcbe --- /dev/null +++ b/tests/Regression/static-relocations-not-known-to-older-linkers/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Regression/static-relocations-not-known-to-older-linkers +# Description: static-relocations-not-known-to-older-linkers +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Regression/static-relocations-not-known-to-older-linkers +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: static-relocations-not-known-to-older-linkers" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1508966" >> $(METADATA) + @echo "Releases: RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/static-relocations-not-known-to-older-linkers/PURPOSE b/tests/Regression/static-relocations-not-known-to-older-linkers/PURPOSE new file mode 100644 index 0000000..9a09bad --- /dev/null +++ b/tests/Regression/static-relocations-not-known-to-older-linkers/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Regression/static-relocations-not-known-to-older-linkers +Description: static-relocations-not-known-to-older-linkers +Author: Martin Cermak +Bug summary: Need to rebuild rpm in order to remove static relocations not known to older linkers +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1508966 diff --git a/tests/Regression/static-relocations-not-known-to-older-linkers/main.fmf b/tests/Regression/static-relocations-not-known-to-older-linkers/main.fmf new file mode 100644 index 0000000..894fc70 --- /dev/null +++ b/tests/Regression/static-relocations-not-known-to-older-linkers/main.fmf @@ -0,0 +1,15 @@ +summary: static-relocations-not-known-to-older-linkers +description: | + Bug summary: Need to rebuild rpm in order to remove static relocations not known to older linkers + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1508966 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils-devel +duration: 48h +extra-summary: /tools/elfutils/Regression/static-relocations-not-known-to-older-linkers +extra-task: /tools/elfutils/Regression/static-relocations-not-known-to-older-linkers diff --git a/tests/Regression/static-relocations-not-known-to-older-linkers/runtest.sh b/tests/Regression/static-relocations-not-known-to-older-linkers/runtest.sh new file mode 100755 index 0000000..3519d05 --- /dev/null +++ b/tests/Regression/static-relocations-not-known-to-older-linkers/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Regression/static-relocations-not-known-to-older-linkers +# Description: static-relocations-not-known-to-older-linkers +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + relocs=$(mktemp) + for i in `rpm -ql elfutils-devel`; do readelf -r -W $i; done > $relocs + # The above is expected to complain about some files not being ELF files, + # such as *.h files or directories ... ;-) + rlRun "grep -e GOTPCRELX -e GOT32X $relocs" 1 + # for elfutils-devel-0.170-1.el7.x86_64.rpm, the unwanted relocation is + # (only) in /usr/lib64/libebl.a + # readelf -r -W /usr/lib64/libebl.a | grep -e GOTPCRELX -e GOT32X + # 00000000000001ef 000000250000002a R_X86_64_REX_GOTPCRELX 0000000000000000 stdout - 4 + rm $relocs + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/elfutils-debuginfod/Makefile b/tests/Sanity/elfutils-debuginfod/Makefile new file mode 100644 index 0000000..0594636 --- /dev/null +++ b/tests/Sanity/elfutils-debuginfod/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Sanity/elfutils-debuginfod +# Description: elfutils-debuginfod +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Sanity/elfutils-debuginfod +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE body.sh sshpass-debuginfo-1.06-2.el8.x86_64.rpm + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + test -x body.sh || chmod a+x body.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: elfutils-debuginfod" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: elfutils-debuginfod elfutils-debuginfod-client" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/elfutils-debuginfod/PURPOSE b/tests/Sanity/elfutils-debuginfod/PURPOSE new file mode 100644 index 0000000..6ecbd65 --- /dev/null +++ b/tests/Sanity/elfutils-debuginfod/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Sanity/elfutils-debuginfod +Description: elfutils-debuginfod +Author: Martin Cermak diff --git a/tests/Sanity/elfutils-debuginfod/body.sh b/tests/Sanity/elfutils-debuginfod/body.sh new file mode 100755 index 0000000..fa91438 --- /dev/null +++ b/tests/Sanity/elfutils-debuginfod/body.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +set -xeo pipefail + +# Initial cleanup +systemctl stop debuginfod +rm -rf ~/.cache/debuginfod_client +rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache +journalctl -g debuginfod -f & +logger=$! + + +# Set up a delay. A delay of 3 worked for me reliably for manual testing. +DELAY=120 + +# Clean up after possible previous failed (=> unfinished) run of this testcase +rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache + +# Check the config file is there +cat /etc/sysconfig/debuginfod + +# Make sure the config file doesn't contain unwanted relicts +# from possible previous failed run of this testcase +fgrep DEBUGINFOD_PATHS /etc/sysconfig/debuginfod | (! fgrep /usr/src/my_extra_rpms) + +# Add some directory to the DEBUGINFOD_PATH and configure it +# within /etc/sysconfig/debuginfod +mkdir -p /usr/src/my_extra_rpms +sed -i 's/DEBUGINFOD_PATHS="[^"]*/\0\ \/usr\/src\/my_extra_rpms/' /etc/sysconfig/debuginfod +fgrep DEBUGINFOD_PATHS /etc/sysconfig/debuginfod | fgrep /usr/src/my_extra_rpms + +# Note the DEBUGINFOD_PORT in the sysconfig file +# and use it to export the server URL for the client to use +source /etc/sysconfig/debuginfod +export DEBUGINFOD_URLS="localhost:$DEBUGINFOD_PORT" + +# Get the build-id from some installed binary and make sure +# it isn't found +buildid=$(eu-unstrip -n -e /usr/bin/true | cut -f2 -d\ | cut -f1 -d@) +! debuginfod-find executable $buildid + +# Start the service +systemctl start debuginfod + +# Give it some time to index +sleep $DELAY + +# Now the binary should be found +debuginfod-find executable $buildid + +# Take a small debuginfo rpm and make sure you know the buildid of +# some .debug file in to the directory you created and added to +# the DEBUGINFO_PATH in the config file. +cp sshpass-debuginfo-1.06-2.el8.x86_64.rpm /usr/src/my_extra_rpms + +# Make sure the denuginfo can't be found yet +! debuginfod-find debuginfo 17ea386087f263827e0cb57fd0d888feb3035d3d + +# Tell debuginfod to start indexing immediately +debuginfod_pid=$(systemctl status debuginfod | fgrep PID | grep -Po '\d+') +kill -SIGUSR1 $debuginfod_pid + +# Give it some time to index +sleep $DELAY + +# Try to find the debug file with the known buildid +debuginfod-find debuginfo 17ea386087f263827e0cb57fd0d888feb3035d3d + +# Clean up +rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache + +# Kill the logger +kill $logger diff --git a/tests/Sanity/elfutils-debuginfod/main.fmf b/tests/Sanity/elfutils-debuginfod/main.fmf new file mode 100644 index 0000000..4b43ee8 --- /dev/null +++ b/tests/Sanity/elfutils-debuginfod/main.fmf @@ -0,0 +1,15 @@ +summary: elfutils-debuginfod +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- elfutils-debuginfod +- elfutils-debuginfod-client +duration: 48h +extra-summary: /tools/elfutils/Sanity/elfutils-debuginfod +extra-task: /tools/elfutils/Sanity/elfutils-debuginfod diff --git a/tests/Sanity/elfutils-debuginfod/runtest.sh b/tests/Sanity/elfutils-debuginfod/runtest.sh new file mode 100755 index 0000000..ef53fc9 --- /dev/null +++ b/tests/Sanity/elfutils-debuginfod/runtest.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Sanity/elfutils-debuginfod +# Description: elfutils-debuginfod +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +__showgreenlight () +{ + rlJournalStart + rlPhaseStartTest + rlRun "echo \"Irrelevant for $X_SCLS\"" + rlPhaseEnd + rlJournalEnd + exit 0 +} + +echo $X_SCLS | fgrep -q toolset && __showgreenlight + +rlJournalStart + rlPhaseStartSetup + for p in elfutils-debuginfod elfutils-debuginfod-client; do + rlAssertRpm $p + done + rlRun "TMPD=$(mktemp -d)" + rlRun "cp body.sh sshpass-debuginfo-1.06-2.el8.x86_64.rpm $TMPD" + rlRun "pushd $TMPD" + rlFileBackup /etc/sysconfig/debuginfod + rlPhaseEnd + + rlPhaseStartTest + rlRun "./body.sh" + rlPhaseEnd + + rlPhaseStartCleanup + rlFileRestore + rlRun "popd" + rlRun "rm -r $TMPD" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/elfutils-debuginfod/sshpass-debuginfo-1.06-2.el8.x86_64.rpm b/tests/Sanity/elfutils-debuginfod/sshpass-debuginfo-1.06-2.el8.x86_64.rpm new file mode 100644 index 0000000..6ca4880 Binary files /dev/null and b/tests/Sanity/elfutils-debuginfod/sshpass-debuginfo-1.06-2.el8.x86_64.rpm differ diff --git a/tests/Sanity/yama-scope/Makefile b/tests/Sanity/yama-scope/Makefile new file mode 100644 index 0000000..381a66c --- /dev/null +++ b/tests/Sanity/yama-scope/Makefile @@ -0,0 +1,66 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Sanity/yama-scope +# Description: yama-scope +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Sanity/yama-scope +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE ptrace-scope-test.sh + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + cp ptrace-scope-test.sh /tmp/ + test -x /tmp/ptrace-scope-test.sh || chmod a+x /tmp/ptrace-scope-test.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: yama-scope" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1455514" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/yama-scope/PURPOSE b/tests/Sanity/yama-scope/PURPOSE new file mode 100644 index 0000000..2ba3374 --- /dev/null +++ b/tests/Sanity/yama-scope/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Sanity/yama-scope +Description: yama-scope +Author: Martin Cermak +Bug summary: Enable provide_yama_scope for rhel >= 7.4 +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455514 diff --git a/tests/Sanity/yama-scope/main.fmf b/tests/Sanity/yama-scope/main.fmf new file mode 100644 index 0000000..fb15aec --- /dev/null +++ b/tests/Sanity/yama-scope/main.fmf @@ -0,0 +1,15 @@ +summary: yama-scope +description: | + Bug summary: Enable provide_yama_scope for rhel >= 7.4 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1455514 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Sanity/yama-scope +extra-task: /tools/elfutils/Sanity/yama-scope diff --git a/tests/Sanity/yama-scope/ptrace-scope-test.sh b/tests/Sanity/yama-scope/ptrace-scope-test.sh new file mode 100644 index 0000000..6eb1ca4 --- /dev/null +++ b/tests/Sanity/yama-scope/ptrace-scope-test.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +RETVAL=0 +OUT=$(mktemp) +eu-stack -p $$ |& tee $OUT +grep -i 'operation not permitted' $OUT && RETVAL=1 +rm $OUT +exit $RETVAL diff --git a/tests/Sanity/yama-scope/runtest.sh b/tests/Sanity/yama-scope/runtest.sh new file mode 100755 index 0000000..03ad07b --- /dev/null +++ b/tests/Sanity/yama-scope/runtest.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Sanity/yama-scope +# Description: yama-scope +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" +MY_USER="ptrace_scope_testuser" +TESTCASE="/tmp/ptrace-scope-test.sh" +PROCFILE='/proc/sys/kernel/yama/ptrace_scope' + +test_root() +{ + $TESTCASE +} + +test_user() +{ + su - $MY_USER -c $TESTCASE +} + +rlJournalStart + rlPhaseStartTest + if rlIsRHEL 6; then + rlLogInfo "Irrelevant env.." + rlPhaseEnd + rlJournalPrintText + rlJournalEnd + exit 0 + fi + + if test -f $PROCFILE; then + +# This can easily be tested with strace. Just cycle through the settings: + +# 0 - Default attach security permissions. +# 1 - Restricted attach. Only child processes plus normal permissions. +# 2 - Admin-only attach. Only executables with CAP_SYS_PTRACE. +# 3 - No attach. No process may call ptrace at all. Irrevocable. + +# echo 0 > /proc/sys/kernel/yama/ptrace_scope + +# With 0, strace works against any process with your uid. For example, strace -p 2190. +# With 1, strace errors when doing the same as in 0: strace: attach: ptrace(PTRACE_SEIZE, 3180): Operation not permitted. However, you can strace any program you run from strace, "strace /bin/ls" or example. +# With 2, you can only strace from the root account. You can no longer strace commands run from strace. +# With 3, even root cannot strace. + +# --- + +# possible related AVCs tracked as https://bugzilla.redhat.com/show_bug.cgi?id=1458999 + +# --- + + rlRun "useradd $MY_USER" 0,9 + + rlRun "ORIGVAL=$( cat $PROCFILE )" + + # First, test the default behaviour, which is "no restriction" + # from the ptrace perspective. Here we assume that + # elfutils-default-yama-scope.rpm is installed and so the default + # yama policy is set to 0 instead of 1 which would otherwise be set + # as a kernel default (security/yama/yama_lsm.c ---> YAMA_SCOPE_RELATIONAL) + rlRun test_root + rlRun test_user + + rlRun "echo 0 > $PROCFILE" + rlRun test_root + rlRun test_user + rlRun "echo 1 > $PROCFILE" + rlRun test_root + rlRun test_user 1 + rlRun "echo 2 > $PROCFILE" + rlRun test_root + rlRun test_user 1 + # Following subtest would be irrevertible (till next reboot) + # rlRun "echo 3 > $PROCFILE" + # rlRun test_root 1 + # rlRun test_user 1 + + rlRun "userdel -f $MY_USER" + +# This testcase could be more complex - using child and non-child processes and +# performing reboots. But let's keep this simple, since we are not testing the +# kernel facility, but merely an elfutils "plugin" for it, whose purpose is to +# set the default yama policy as such. + + rlRun "echo $ORIGVAL > $PROCFILE" + + else + # Yama had been enabled in rhel-7.4 kernel within + # dist-git commit 9f3dff2c9ce3a6607c6342fc00b8fc82c6167ec6 + # which is kernel-3.10.0-677.el7. + rlLogInfo "Not a YAMA enabled kernel" + fi + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/Makefile b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/Makefile new file mode 100644 index 0000000..09a9e16 --- /dev/null +++ b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read +# Description: CVE-2018-16062-elfutils-Heap-based-buffer-over-read +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE addr2line-buffer-over-flow1 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-16062-elfutils-Heap-based-buffer-over-read" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1625260" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/PURPOSE b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/PURPOSE new file mode 100644 index 0000000..3281134 --- /dev/null +++ b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read +Description: CVE-2018-16062-elfutils-Heap-based-buffer-over-read +Author: Martin Cermak +Bug summary: 2 elfutils: Heap-based buffer over-read in libdw/dwarf_getaranges.c:dwarf_getaranges() via crafted file [rhel-7] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625260 diff --git a/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/addr2line-buffer-over-flow1 b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/addr2line-buffer-over-flow1 new file mode 100644 index 0000000..8db05cc Binary files /dev/null and b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/addr2line-buffer-over-flow1 differ diff --git a/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/main.fmf b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/main.fmf new file mode 100644 index 0000000..4d5ddab --- /dev/null +++ b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-16062-elfutils-Heap-based-buffer-over-read +description: | + Bug summary: 2 elfutils: Heap-based buffer over-read in libdw/dwarf_getaranges.c:dwarf_getaranges() via crafted file [rhel-7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625260 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read +extra-task: /tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read diff --git a/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/runtest.sh b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/runtest.sh new file mode 100755 index 0000000..fa3fc0c --- /dev/null +++ b/tests/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-16062-elfutils-Heap-based-buffer-over-read +# Description: CVE-2018-16062-elfutils-Heap-based-buffer-over-read +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # Reproduced with elfutils-0.172-2.el7.x86_64 valgrind-3.13.0-13.el7.x86_64 + rlRun "valgrind -q --error-exitcode=99 eu-addr2line -e addr2line-buffer-over-flow1 -- 500 50 10 -1000" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Double-free-libelf b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Double-free-libelf new file mode 100644 index 0000000..da7ce21 Binary files /dev/null and b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Double-free-libelf differ diff --git a/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Makefile b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Makefile new file mode 100644 index 0000000..a434dfa --- /dev/null +++ b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression +# Description: CVE-2018-16402-double-free-due-to-double-decompression +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE Double-free-libelf + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-16402-double-free-due-to-double-decompression" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: nothing" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1625052" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/PURPOSE b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/PURPOSE new file mode 100644 index 0000000..2b1d552 --- /dev/null +++ b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression +Description: CVE-2018-16402-double-free-due-to-double-decompression +Author: Martin Cermak +Bug summary: 2 elfutils: Double-free due to double decompression of sections in crafted ELF causes crash [rhel-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625052 diff --git a/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/main.fmf b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/main.fmf new file mode 100644 index 0000000..f7be31f --- /dev/null +++ b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-16402-double-free-due-to-double-decompression +description: | + Bug summary: 2 elfutils: Double-free due to double decompression of sections in crafted ELF causes crash [rhel-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625052 +contact: +- Martin Cermak +component: +- nothing +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression +extra-task: /tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression diff --git a/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/runtest.sh b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/runtest.sh new file mode 100755 index 0000000..96e322b --- /dev/null +++ b/tests/Security/CVE-2018-16402-double-free-due-to-double-decompression/runtest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-16402-double-free-due-to-double-decompression +# Description: CVE-2018-16402-double-free-due-to-double-decompression +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + TMP=$(mktemp) + rlRun "valgrind -q eu-readelf -S ./Double-free-libelf |& tee $TMP" + rlRun "fgrep 'Invalid free()' $TMP" 1 + rlRun "fgrep 'Section Headers:' $TMP" + rm -f $TMP + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Buffer-over-readelf b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Buffer-over-readelf new file mode 100644 index 0000000..4b214cd Binary files /dev/null and b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Buffer-over-readelf differ diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Makefile b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Makefile new file mode 100644 index 0000000..de1c93a --- /dev/null +++ b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +# Description: CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE Buffer-over-readelf bz1532205.supp + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: nothing" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1625057" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/PURPOSE b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/PURPOSE new file mode 100644 index 0000000..10589cc --- /dev/null +++ b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +Description: CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +Author: Martin Cermak +Bug summary: 3 elfutils: Heap-based buffer over-read in libdw/dwarf_getabbrev.c and libwd/dwarf_hasattr.c causes crash [rhel-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625057 diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/bz1532205.supp b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/bz1532205.supp new file mode 100644 index 0000000..70f0f80 --- /dev/null +++ b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/bz1532205.supp @@ -0,0 +1,25 @@ +{ + + Memcheck:Cond + fun:_nl_explode_name +} +{ + + Memcheck:Cond + fun:_nl_make_l10nflist +} +{ + + Memcheck:Addr4 + fun:_nl_make_l10nflist +} +{ + + Memcheck:Addr4 + fun:new_composite_name +} +{ + + Memcheck:Cond + fun:_nl_explode_name +} diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/main.fmf b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/main.fmf new file mode 100644 index 0000000..e934d57 --- /dev/null +++ b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +description: | + Bug summary: 3 elfutils: Heap-based buffer over-read in libdw/dwarf_getabbrev.c and libwd/dwarf_hasattr.c causes crash [rhel-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1625057 +contact: +- Martin Cermak +component: +- nothing +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +extra-task: /tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c diff --git a/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/runtest.sh b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/runtest.sh new file mode 100755 index 0000000..ffd6160 --- /dev/null +++ b/tests/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +# Description: CVE-2018-16403-heap-based-buffer-over-read-in-libdw-dwarf_getabbrev-c +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + arch | grep -q ppc64le && VGSUPP='--suppressions=bz1532205.supp' || VGSUPP='' + TMP=$(mktemp) + rlRun "valgrind $VGSUPP -q eu-readelf --debug-dump=abbrev ./Buffer-over-readelf |& tee $TMP" + rlRun "fgrep 'Invalid read of size' $TMP" 1 + rlRun "fgrep 'Abbreviation section at offset' $TMP" + rm -f $TMP + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/Makefile b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/Makefile new file mode 100644 index 0000000..de96661 --- /dev/null +++ b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference +# Description: CVE-2018-18310-elfutils-invalid-memory-address-dereference +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC-stack + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18310-elfutils-invalid-memory-address-dereference" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1651567" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/POC-stack b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/POC-stack new file mode 100644 index 0000000..2b486e8 Binary files /dev/null and b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/POC-stack differ diff --git a/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/PURPOSE b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/PURPOSE new file mode 100644 index 0000000..6688efc --- /dev/null +++ b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference +Description: CVE-2018-18310-elfutils-invalid-memory-address-dereference +Author: Martin Cermak +Bug summary: 0 elfutils: invalid memory address dereference was discovered in dwfl_segment_report_module.c in libdwfl [rhdts-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1651567 diff --git a/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/main.fmf b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/main.fmf new file mode 100644 index 0000000..6ab4075 --- /dev/null +++ b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/main.fmf @@ -0,0 +1,15 @@ +summary: CVE-2018-18310-elfutils-invalid-memory-address-dereference +description: | + Bug summary: 0 elfutils: invalid memory address dereference was discovered in dwfl_segment_report_module.c in libdwfl [rhdts-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1651567 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference +extra-task: /tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference diff --git a/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/runtest.sh b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/runtest.sh new file mode 100755 index 0000000..09c885c --- /dev/null +++ b/tests/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18310-elfutils-invalid-memory-address-dereference +# Description: CVE-2018-18310-elfutils-invalid-memory-address-dereference +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # Expect exitcode 2, unfixed package segfaults (139) + rlRun "eu-stack --core=POC-stack" 2 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/Makefile b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/Makefile new file mode 100644 index 0000000..6a50f8a --- /dev/null +++ b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference +# Description: CVE-2018-18310-invalid-memory-address-dereference +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC-stack bz1532205.supp + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18310-invalid-memory-address-dereference" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: nothing" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1642606" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/POC-stack b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/POC-stack new file mode 100644 index 0000000..2b486e8 Binary files /dev/null and b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/POC-stack differ diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/PURPOSE b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/PURPOSE new file mode 100644 index 0000000..eb0721d --- /dev/null +++ b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference +Description: CVE-2018-18310-invalid-memory-address-dereference +Author: Martin Cermak +Bug summary: 0 elfutils: invalid memory address dereference was discovered in dwfl_segment_report_module.c in libdwfl [rhel-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1642606 diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/bz1532205.supp b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/bz1532205.supp new file mode 100644 index 0000000..70f0f80 --- /dev/null +++ b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/bz1532205.supp @@ -0,0 +1,25 @@ +{ + + Memcheck:Cond + fun:_nl_explode_name +} +{ + + Memcheck:Cond + fun:_nl_make_l10nflist +} +{ + + Memcheck:Addr4 + fun:_nl_make_l10nflist +} +{ + + Memcheck:Addr4 + fun:new_composite_name +} +{ + + Memcheck:Cond + fun:_nl_explode_name +} diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/main.fmf b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/main.fmf new file mode 100644 index 0000000..86d6871 --- /dev/null +++ b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-18310-invalid-memory-address-dereference +description: | + Bug summary: 0 elfutils: invalid memory address dereference was discovered in dwfl_segment_report_module.c in libdwfl [rhel-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1642606 +contact: +- Martin Cermak +component: +- nothing +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference +extra-task: /tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference diff --git a/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/runtest.sh b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/runtest.sh new file mode 100755 index 0000000..ba44f8d --- /dev/null +++ b/tests/Security/CVE-2018-18310-invalid-memory-address-dereference/runtest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18310-invalid-memory-address-dereference +# Description: CVE-2018-18310-invalid-memory-address-dereference +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + arch | grep -q ppc64le && VGSUPP='--suppressions=bz1532205.supp' || VGSUPP='' + TMP=$(mktemp) + rlRun "valgrind $VGSUPP -q eu-stack --core=./POC-stack |& tee $TMP" + rlRun "fgrep 'Invalid read of size' $TMP" 1 + rm -f $TMP + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/Makefile b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/Makefile new file mode 100644 index 0000000..1728cdc --- /dev/null +++ b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +# Description: CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC1 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1651200" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/POC1 b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/POC1 new file mode 100644 index 0000000..1f6c719 Binary files /dev/null and b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/POC1 differ diff --git a/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/PURPOSE b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/PURPOSE new file mode 100644 index 0000000..3c71880 --- /dev/null +++ b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +Description: CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +Author: Martin Cermak diff --git a/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/main.fmf b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/main.fmf new file mode 100644 index 0000000..417d678 --- /dev/null +++ b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/main.fmf @@ -0,0 +1,13 @@ +summary: CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +extra-task: /tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files diff --git a/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/runtest.sh b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/runtest.sh new file mode 100755 index 0000000..b29cf5b --- /dev/null +++ b/tests/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files/runtest.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +# Description: CVE-2018-18520-elfutils-eu-size-cannot-handle-recursive-ar-files +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + rlRun "eu-size POC1" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/Makefile b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/Makefile new file mode 100644 index 0000000..8375a2c --- /dev/null +++ b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +# Description: CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1646479" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/POC2 b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/POC2 new file mode 100644 index 0000000..2221cf4 Binary files /dev/null and b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/POC2 differ diff --git a/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/PURPOSE b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/PURPOSE new file mode 100644 index 0000000..4bc7058 --- /dev/null +++ b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +Description: CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +Author: Martin Cermak +Bug summary: 0 elfutils: eu-size cannot handle recursive ar files [rhel-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1646479 diff --git a/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/main.fmf b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/main.fmf new file mode 100644 index 0000000..65de371 --- /dev/null +++ b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +description: | + Bug summary: 0 elfutils: eu-size cannot handle recursive ar files [rhel-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1646479 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +extra-task: /tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files diff --git a/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/runtest.sh b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/runtest.sh new file mode 100755 index 0000000..ff22f65 --- /dev/null +++ b/tests/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files/runtest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +# Description: CVE-2018-18520-eu-size-cannot-handle-recursive-ar-files +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + TMP=$(mktemp) + rlRun "valgrind -q eu-size ./POC2 |& tee $TMP" + rlRun "fgrep 'Process terminating with default action of signal 11' $TMP" 1 + rm -f $TMP + rlRun "eu-size ./POC2" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18521-divide-by-zero/Makefile b/tests/Security/CVE-2018-18521-divide-by-zero/Makefile new file mode 100644 index 0000000..0f5c03e --- /dev/null +++ b/tests/Security/CVE-2018-18521-divide-by-zero/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18521-divide-by-zero +# Description: CVE-2018-18521-divide-by-zero +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18521-divide-by-zero +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18521-divide-by-zero" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1646484" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18521-divide-by-zero/POC2 b/tests/Security/CVE-2018-18521-divide-by-zero/POC2 new file mode 100644 index 0000000..f4edc40 Binary files /dev/null and b/tests/Security/CVE-2018-18521-divide-by-zero/POC2 differ diff --git a/tests/Security/CVE-2018-18521-divide-by-zero/PURPOSE b/tests/Security/CVE-2018-18521-divide-by-zero/PURPOSE new file mode 100644 index 0000000..06fa1fb --- /dev/null +++ b/tests/Security/CVE-2018-18521-divide-by-zero/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18521-divide-by-zero +Description: CVE-2018-18521-divide-by-zero +Author: Martin Cermak +Bug summary: 1 elfutils: Divide-by-zero in arlib_add_symbols function in arlib.c [rhel-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1646484 diff --git a/tests/Security/CVE-2018-18521-divide-by-zero/main.fmf b/tests/Security/CVE-2018-18521-divide-by-zero/main.fmf new file mode 100644 index 0000000..f288788 --- /dev/null +++ b/tests/Security/CVE-2018-18521-divide-by-zero/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2018-18521-divide-by-zero +description: | + Bug summary: 1 elfutils: Divide-by-zero in arlib_add_symbols function in arlib.c [rhel-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1646484 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18521-divide-by-zero +extra-task: /tools/elfutils/Security/CVE-2018-18521-divide-by-zero diff --git a/tests/Security/CVE-2018-18521-divide-by-zero/runtest.sh b/tests/Security/CVE-2018-18521-divide-by-zero/runtest.sh new file mode 100755 index 0000000..4f83999 --- /dev/null +++ b/tests/Security/CVE-2018-18521-divide-by-zero/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18521-divide-by-zero +# Description: CVE-2018-18521-divide-by-zero +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # This doesn't reproduce on ppach64 and ppc64le. + TMP=$(mktemp) + rlRun "valgrind -q eu-ranlib ./POC2 |& tee $TMP" + rlRun "fgrep 'Process terminating with default action of signal 8' $TMP" 1 + rm -f $TMP + rlRun "eu-ranlib ./POC2" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/Makefile b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/Makefile new file mode 100644 index 0000000..075bcd7 --- /dev/null +++ b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +# Description: CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1651203" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/POC2 b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/POC2 new file mode 100644 index 0000000..f4edc40 Binary files /dev/null and b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/POC2 differ diff --git a/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/PURPOSE b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/PURPOSE new file mode 100644 index 0000000..2a100e2 --- /dev/null +++ b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +Description: CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +Author: Martin Cermak +Bug summary: 1 elfutils: Divide-by-zero in arlib_add_symbols function in arlib.c [rhdts-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1651203 diff --git a/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/main.fmf b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/main.fmf new file mode 100644 index 0000000..645e9a6 --- /dev/null +++ b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/main.fmf @@ -0,0 +1,15 @@ +summary: CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +description: | + Bug summary: 1 elfutils: Divide-by-zero in arlib_add_symbols function in arlib.c [rhdts-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1651203 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +extra-task: /tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c diff --git a/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/runtest.sh b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/runtest.sh new file mode 100755 index 0000000..aa345b7 --- /dev/null +++ b/tests/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c/runtest.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +# Description: CVE-2018-18521-elfutils-Divide-by-zero-in-arlib_add_symbols-function-in-arlib-c +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + rlRun "eu-ranlib POC2" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2019-7146/Makefile b/tests/Security/CVE-2019-7146/Makefile new file mode 100644 index 0000000..1f4cb6e --- /dev/null +++ b/tests/Security/CVE-2019-7146/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2019-7146 +# Description: CVE-2019-7146 +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2019-7146 +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE poc + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2019-7146" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Requires: valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2019-7146/PURPOSE b/tests/Security/CVE-2019-7146/PURPOSE new file mode 100644 index 0000000..0770c49 --- /dev/null +++ b/tests/Security/CVE-2019-7146/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/elfutils/Security/CVE-2019-7146 +Description: CVE-2019-7146 +Author: Martin Cermak diff --git a/tests/Security/CVE-2019-7146/main.fmf b/tests/Security/CVE-2019-7146/main.fmf new file mode 100644 index 0000000..d690650 --- /dev/null +++ b/tests/Security/CVE-2019-7146/main.fmf @@ -0,0 +1,14 @@ +summary: CVE-2019-7146 +description: '' +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2019-7146 +extra-task: /tools/elfutils/Security/CVE-2019-7146 diff --git a/tests/Security/CVE-2019-7146/poc b/tests/Security/CVE-2019-7146/poc new file mode 100644 index 0000000..a27f86b Binary files /dev/null and b/tests/Security/CVE-2019-7146/poc differ diff --git a/tests/Security/CVE-2019-7146/runtest.sh b/tests/Security/CVE-2019-7146/runtest.sh new file mode 100755 index 0000000..fb8cd3f --- /dev/null +++ b/tests/Security/CVE-2019-7146/runtest.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2019-7146 +# Description: CVE-2019-7146 +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # https://svn.devel.redhat.com/repos/srtvulns/trunk/components/elfutils/CVE-2019-7146/ + # Expected Output + # An error instead of segfault. + rlRun "valgrind -q --error-exitcode=99 eu-readelf -a ./poc" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/Makefile b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/Makefile new file mode 100644 index 0000000..b022ffa --- /dev/null +++ b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read +# Description: CVE-2019-7149-elfutils-heap-based-buffer-over-read +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC1 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2019-7149-elfutils-heap-based-buffer-over-read" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1680056" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/POC1 b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/POC1 new file mode 100644 index 0000000..63698a3 Binary files /dev/null and b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/POC1 differ diff --git a/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/PURPOSE b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/PURPOSE new file mode 100644 index 0000000..f09b1b4 --- /dev/null +++ b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read +Description: CVE-2019-7149-elfutils-heap-based-buffer-over-read +Author: Martin Cermak +Bug summary: elfutils: heap-based buffer over-read in read_srclines in dwarf_getsrclines.c in libdw [rhdts-8] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680056 diff --git a/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/main.fmf b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/main.fmf new file mode 100644 index 0000000..b598856 --- /dev/null +++ b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2019-7149-elfutils-heap-based-buffer-over-read +description: | + Bug summary: elfutils: heap-based buffer over-read in read_srclines in dwarf_getsrclines.c in libdw [rhdts-8] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680056 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read +extra-task: /tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read diff --git a/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/runtest.sh b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/runtest.sh new file mode 100755 index 0000000..bac258f --- /dev/null +++ b/tests/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2019-7149-elfutils-heap-based-buffer-over-read +# Description: CVE-2019-7149-elfutils-heap-based-buffer-over-read +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + rlRun "which valgrind eu-nm" + # With RHEL I saw the invalid read of size 1 on aarch64 and ppc64le + # using devtoolset-7-elfutils-0.170-5.el7. I also saw it on x86_64 + # with base rhel elfutils-0.172-2.el7.x86_64. + # IOW - It doesn't reproduce "everywhere". + rlRun "valgrind -q --error-exitcode=99 eu-nm -C POC1" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/Makefile b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/Makefile new file mode 100644 index 0000000..99a9c61 --- /dev/null +++ b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +# Description: CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2019-7150-segmentation-fault-in-elf64_xlatetom" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1680046" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC1 b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC1 new file mode 100644 index 0000000..abd8c65 Binary files /dev/null and b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC1 differ diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC2 b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC2 new file mode 100644 index 0000000..0c1a4d0 Binary files /dev/null and b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/POC2 differ diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/PURPOSE b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/PURPOSE new file mode 100644 index 0000000..c26e276 --- /dev/null +++ b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +Description: CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +Author: Martin Cermak +Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhel-7] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680046 diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/main.fmf b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/main.fmf new file mode 100644 index 0000000..e2f01bc --- /dev/null +++ b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +description: | + Bug summary: elfutils: segmentation fault in elf64_xlatetom in libelf/elf32_xlatetom.c [rhel-7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1680046 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +extra-task: /tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom diff --git a/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/runtest.sh b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/runtest.sh new file mode 100755 index 0000000..3151176 --- /dev/null +++ b/tests/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom/runtest.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +# Description: CVE-2019-7150-segmentation-fault-in-elf64_xlatetom +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # An error is expected (2), but a SEGV is not (139). + # Reproduced with elfutils-0.172-2.el7, verified with elfutils-0.176-1.el7 + rlRun "valgrind -q --error-exitcode=99 eu-stack --core=POC2" 2 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/Makefile b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/Makefile new file mode 100644 index 0000000..352a559 --- /dev/null +++ b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +# Description: CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1679071" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/POC b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/POC new file mode 100644 index 0000000..e449ac2 Binary files /dev/null and b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/POC differ diff --git a/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/PURPOSE b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/PURPOSE new file mode 100644 index 0000000..dbdbfc3 --- /dev/null +++ b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +Description: CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +Author: Martin Cermak +Bug summary: elfutils: Out of bound write in elf_cvt_note in libelf/note_xlate.h [rhel-7] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1679071 diff --git a/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/main.fmf b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/main.fmf new file mode 100644 index 0000000..a8720df --- /dev/null +++ b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +description: | + Bug summary: elfutils: Out of bound write in elf_cvt_note in libelf/note_xlate.h [rhel-7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1679071 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +extra-task: /tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note diff --git a/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/runtest.sh b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/runtest.sh new file mode 100755 index 0000000..5b1c28e --- /dev/null +++ b/tests/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note/runtest.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +# Description: CVE-2019-7664-Out-of-bound-write-in-elf_cvt_note +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # Reproduced with elfutils-0.174-5.fc28.x86_64 + # This is expected to fail (1), but not to segfault (139). + rlRun "valgrind -q --error-exitcode=99 eu-elflint -d POC" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/Makefile b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/Makefile new file mode 100644 index 0000000..6d2f4dc --- /dev/null +++ b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +# Description: CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE POC2 + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 48h" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1679078" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/POC2 b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/POC2 new file mode 100644 index 0000000..0776e61 Binary files /dev/null and b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/POC2 differ diff --git a/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/PURPOSE b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/PURPOSE new file mode 100644 index 0000000..7fc62cd --- /dev/null +++ b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +Description: CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +Author: Martin Cermak +Bug summary: elfutils: heap-based buffer over-read in function elf32_xlatetom in elf32_xlatetom.c [rhel-7] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1679078 diff --git a/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/main.fmf b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/main.fmf new file mode 100644 index 0000000..7883a64 --- /dev/null +++ b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/main.fmf @@ -0,0 +1,16 @@ +summary: CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +description: | + Bug summary: elfutils: heap-based buffer over-read in function elf32_xlatetom in elf32_xlatetom.c [rhel-7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1679078 +contact: +- Martin Cermak +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +- valgrind +duration: 48h +extra-summary: /tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +extra-task: /tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom diff --git a/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/runtest.sh b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/runtest.sh new file mode 100755 index 0000000..06e697c --- /dev/null +++ b/tests/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom/runtest.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +# Description: CVE-2019-7665-heap-based-buffer-over-read-in-function-elf32_xlatetom +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +rlJournalStart + rlPhaseStartTest + # We expect 1, but not 99 ... + # Reproduced with valgrind-3.13.0-13.el7 and elfutils-0.172-2.el7 + # Verified with valgrind-3.14.0-16.el7 and elfutils-0.176-1.el7 + rlRun "valgrind -q --error-exitcode=99 eu-readelf -a POC2" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/Makefile b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/Makefile new file mode 100644 index 0000000..7677f90 --- /dev/null +++ b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow +# Description: CVE-2014-0172 elfutils: integer overflow, leading to a heap-based buffer overflow in libdw +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE dwz-overflow.elf + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Vaclav Kadlcik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: CVE-2014-0172 elfutils: integer overflow, leading to a heap-based buffer overflow in libdw" >> $(METADATA) + @echo "Type: Security" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Requires: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: yes" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1139128" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/PURPOSE b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/PURPOSE new file mode 100644 index 0000000..419b4a6 --- /dev/null +++ b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow +Description: CVE-2014-0172 elfutils: integer overflow, leading to a heap-based buffer overflow in libdw +Author: Vaclav Kadlcik +Bug summary: elfutils: integer overflow, leading to a heap-based buffer overflow in libdw [rhel-6.6] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1139128 diff --git a/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/dwz-overflow.elf b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/dwz-overflow.elf new file mode 100644 index 0000000..98cdfb0 Binary files /dev/null and b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/dwz-overflow.elf differ diff --git a/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/main.fmf b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/main.fmf new file mode 100644 index 0000000..a2e4032 --- /dev/null +++ b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/main.fmf @@ -0,0 +1,16 @@ +summary: 'CVE-2014-0172 elfutils: integer overflow, leading to a heap-based buffer + overflow in libdw' +description: | + Bug summary: elfutils: integer overflow, leading to a heap-based buffer overflow in libdw [rhel-6.6] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1139128 +contact: +- Vaclav Kadlcik +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- elfutils +duration: 5m +extra-summary: /tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow +extra-task: /tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow diff --git a/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/runtest.sh b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/runtest.sh new file mode 100755 index 0000000..8740e87 --- /dev/null +++ b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/runtest.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/elfutils/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow +# Description: CVE-2014-0172 elfutils: integer overflow, leading to a heap-based buffer overflow in libdw +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="elfutils" + +# Reproducer by Florian Weimer, confidential. +# That is why this test has Confidential: yes. +REPRODUCING_FILE=dwz-overflow.elf + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp $REPRODUCING_FILE $TmpDir" 0 + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + # eu-readelf since 0.153 was vulnerable. + # The following crashed with "Segmentation fault" + # and exit value 139. + rlRun "eu-readelf -w $REPRODUCING_FILE" 0,1 'eu-readelf should not crash' + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/testsuite/Makefile b/tests/testsuite/Makefile new file mode 100644 index 0000000..2e11a75 --- /dev/null +++ b/tests/testsuite/Makefile @@ -0,0 +1,48 @@ +TOPLEVEL_NAMESPACE=/tools +PACKAGE_NAME=elfutils +RELATIVE_PATH=testsuite + +export TESTVERSION=2.0 +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) + +.PHONY: all install download clean + +FILES=$(METADATA) runtest.sh PURPOSE Makefile + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +requires = autoconf automake bison bzip2 bzip2-devel cvs elfutils flex gcc \ + gcc-c++ gettext glibc-headers libstdc++ libstdc++-devel nfs-utils \ + pkgconfig(libarchive) pkgconfig(libcurl) pkgconfig(libmicrohttpd) \ + pkgconfig(sqlite3) rpm-build xz-devel yum-utils zlib-devel + +# https://mojo.redhat.com/docs/DOC-1072127 +dtsver = $(shell seq -s, 9 14) +dtsreq = $(shell echo {dev,gcc-}toolset-{$(dtsver)}-{elfutils{,-devel},gcc{,-c++,-libstdc++,-libstdc++-devel},binutils{,-devel}}) + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: Petr Muller " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: This test runs upstream testsuite for elfutils" >> $(METADATA) + @echo "TestTime: 99m" >> $(METADATA) + @echo "RunFor: elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPL" >> $(METADATA) + $(foreach package, $(requires) $(dtsreq), \ + echo "Requires: $(package)" >> $(METADATA); \ + ) + + rhts-lint $(METADATA) diff --git a/tests/testsuite/PURPOSE b/tests/testsuite/PURPOSE new file mode 100644 index 0000000..567997c --- /dev/null +++ b/tests/testsuite/PURPOSE @@ -0,0 +1,2 @@ +Testsuite encapsulating upstream tests for elfutils, which are included in elfutils src.rpm package. +This test always fetches (from /mnt/redhat/) appropriate version of that src.rpm for installed elfutils. diff --git a/tests/testsuite/main.fmf b/tests/testsuite/main.fmf new file mode 100644 index 0000000..b6ee0ec --- /dev/null +++ b/tests/testsuite/main.fmf @@ -0,0 +1,133 @@ +summary: This test runs upstream testsuite for elfutils +description: | + Testsuite encapsulating upstream tests for elfutils, which are included in elfutils src.rpm package. + This test always fetches (from /mnt/redhat/) appropriate version of that src.rpm for installed elfutils. +contact: +- Petr Muller +component: +- elfutils +test: ./runtest.sh +framework: beakerlib +recommend: +- autoconf +- automake +- bison +- bzip2 +- bzip2-devel +- cvs +- elfutils +- flex +- gcc +- gcc-c++ +- gettext +- glibc-headers +- libstdc++ +- libstdc++-devel +- nfs-utils +- pkgconfig(libarchive) +- pkgconfig(libcurl) +- pkgconfig(libmicrohttpd) +- pkgconfig(sqlite3) +- rpm-build +- xz-devel +- yum-utils +- zlib-devel +- devtoolset-9-elfutils +- devtoolset-9-elfutils-devel +- devtoolset-9-gcc +- devtoolset-9-gcc-c++ +- devtoolset-9-gcc-libstdc++ +- devtoolset-9-gcc-libstdc++-devel +- devtoolset-9-binutils +- devtoolset-9-binutils-devel +- devtoolset-10-elfutils +- devtoolset-10-elfutils-devel +- devtoolset-10-gcc +- devtoolset-10-gcc-c++ +- devtoolset-10-gcc-libstdc++ +- devtoolset-10-gcc-libstdc++-devel +- devtoolset-10-binutils +- devtoolset-10-binutils-devel +- devtoolset-11-elfutils +- devtoolset-11-elfutils-devel +- devtoolset-11-gcc +- devtoolset-11-gcc-c++ +- devtoolset-11-gcc-libstdc++ +- devtoolset-11-gcc-libstdc++-devel +- devtoolset-11-binutils +- devtoolset-11-binutils-devel +- devtoolset-12-elfutils +- devtoolset-12-elfutils-devel +- devtoolset-12-gcc +- devtoolset-12-gcc-c++ +- devtoolset-12-gcc-libstdc++ +- devtoolset-12-gcc-libstdc++-devel +- devtoolset-12-binutils +- devtoolset-12-binutils-devel +- devtoolset-13-elfutils +- devtoolset-13-elfutils-devel +- devtoolset-13-gcc +- devtoolset-13-gcc-c++ +- devtoolset-13-gcc-libstdc++ +- devtoolset-13-gcc-libstdc++-devel +- devtoolset-13-binutils +- devtoolset-13-binutils-devel +- devtoolset-14-elfutils +- devtoolset-14-elfutils-devel +- devtoolset-14-gcc +- devtoolset-14-gcc-c++ +- devtoolset-14-gcc-libstdc++ +- devtoolset-14-gcc-libstdc++-devel +- devtoolset-14-binutils +- devtoolset-14-binutils-devel +- gcc-toolset-9-elfutils +- gcc-toolset-9-elfutils-devel +- gcc-toolset-9-gcc +- gcc-toolset-9-gcc-c++ +- gcc-toolset-9-gcc-libstdc++ +- gcc-toolset-9-gcc-libstdc++-devel +- gcc-toolset-9-binutils +- gcc-toolset-9-binutils-devel +- gcc-toolset-10-elfutils +- gcc-toolset-10-elfutils-devel +- gcc-toolset-10-gcc +- gcc-toolset-10-gcc-c++ +- gcc-toolset-10-gcc-libstdc++ +- gcc-toolset-10-gcc-libstdc++-devel +- gcc-toolset-10-binutils +- gcc-toolset-10-binutils-devel +- gcc-toolset-11-elfutils +- gcc-toolset-11-elfutils-devel +- gcc-toolset-11-gcc +- gcc-toolset-11-gcc-c++ +- gcc-toolset-11-gcc-libstdc++ +- gcc-toolset-11-gcc-libstdc++-devel +- gcc-toolset-11-binutils +- gcc-toolset-11-binutils-devel +- gcc-toolset-12-elfutils +- gcc-toolset-12-elfutils-devel +- gcc-toolset-12-gcc +- gcc-toolset-12-gcc-c++ +- gcc-toolset-12-gcc-libstdc++ +- gcc-toolset-12-gcc-libstdc++-devel +- gcc-toolset-12-binutils +- gcc-toolset-12-binutils-devel +- gcc-toolset-13-elfutils +- gcc-toolset-13-elfutils-devel +- gcc-toolset-13-gcc +- gcc-toolset-13-gcc-c++ +- gcc-toolset-13-gcc-libstdc++ +- gcc-toolset-13-gcc-libstdc++-devel +- gcc-toolset-13-binutils +- gcc-toolset-13-binutils-devel +- gcc-toolset-14-elfutils +- gcc-toolset-14-elfutils-devel +- gcc-toolset-14-gcc +- gcc-toolset-14-gcc-c++ +- gcc-toolset-14-gcc-libstdc++ +- gcc-toolset-14-gcc-libstdc++-devel +- gcc-toolset-14-binutils +- gcc-toolset-14-binutils-devel +duration: 99m +extra-summary: /tools/elfutils/testsuite +extra-task: /tools/elfutils/testsuite diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh new file mode 100755 index 0000000..7685cea --- /dev/null +++ b/tests/testsuite/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +. /usr/share/beakerlib/beakerlib.sh +. /usr/bin/rhts_environment.sh + +rlJournalStart + rlPhaseStartSetup + rlRun "which gcc as" + rlRun "BIN=`which eu-strip`" + rlRun "RPM=`rpm --queryformat='%{name}\n' -qf $BIN`" + rlRun "TMP=$(mktemp -d)" + rlRun "pushd $TMP" + + rlFetchSrcForInstalled $RPM + rlRun "rpm --define='_topdir $TMP' -Uhv *elfutils*.src.rpm" + rlRun "yum-builddep -y $TMP/SPECS/elfutils.spec" + rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/elfutils.spec" + rlRun "pushd BUILD/elfutils-*" + + rlRun "useradd elfutilstest" 0,9 + rlRun "chown -R elfutilstest $TMP" + rlPhaseEnd + + rlPhaseStartTest + wd=$(pwd) + rlRun "su - elfutilstest -c \"make -C $wd check\" |& tee $wd/test.log" + + rlRun "PASSED=$(grep -c "^PASS" test.log )" + rlRun "FAILED=$(grep -c "^FAIL" test.log )" + + rlRun "[[ $PASSED -gt 0 ]]" + rlRun "[[ $FAILED -eq 0 ]]" + + # Archive artifacts + tarball='/tmp/artifacts.tar.xz' + rlRun "rm -rf $tarball" + rlRun "tar cfJ $tarball $TMP" + rlFileSubmit "$tarball" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TMP $tarball" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd + From 56859bccca16b5a30e2721a6bd1cad590a8602d8 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 18 2021 17:21:33 +0000 Subject: [PATCH 2/9] Drop the RHEL-8 related section of gating.yaml --- diff --git a/gating.yaml b/gating.yaml index 84b7773..4fab4ec 100644 --- a/gating.yaml +++ b/gating.yaml @@ -5,13 +5,6 @@ decision_context: bodhi_update_push_stable subject_type: koji_build rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} ---- !Policy -product_versions: - - rhel-8 -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} --- !Policy product_versions: - rhel-9 From fe28fc79b1cc1235367ab34e24c9e8c5a34669d2 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 19 2021 13:38:01 +0000 Subject: [PATCH 3/9] Testing change that might hopefully help triggering the tests. --- diff --git a/plans/ci.fmf b/plans/ci.fmf index 85710d6..1ad2c12 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -3,4 +3,4 @@ discover: how: fmf directory: tests execute: - how: tmt + how: beakerlib From 9e34328419f91c6ed1455620828c83997fe9f088 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 22 2021 08:15:17 +0000 Subject: [PATCH 4/9] Testcase updates --- diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh index 6ccf347..020e519 100755 --- a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh @@ -32,13 +32,14 @@ PACKAGE="$( rpm -qf --queryformat='%{name}\n' `which eu-strip` )" # work around https://github.com/psss/tmt/issues/624 -dnf debuginfo-install -y coreutils findutils gcc gcc-c++ libstdc++ ||: +dnf debuginfo-install -y coreutils findutils gcc gcc-c++ libstdc++ kernel-devel ||: +stap-prep ||: rlJournalStart rlPhaseStartSetup rlAssertRpm "coreutils-debuginfo" rlAssertRpm "findutils-debuginfo" - rlRun "rpm -qa | grep 'gcc-debuginfo'" + rlAssertRpm "gcc-debuginfo" LIBSTDCPP="$( ldd `which stap` | awk '/libstdc++/ {print $3}' )" diff --git a/tests/Sanity/yama-scope/runtest.sh b/tests/Sanity/yama-scope/runtest.sh index 03ad07b..a5df100 100755 --- a/tests/Sanity/yama-scope/runtest.sh +++ b/tests/Sanity/yama-scope/runtest.sh @@ -45,18 +45,6 @@ test_user() rlJournalStart rlPhaseStartTest - if rlIsRHEL 6; then - rlLogInfo "Irrelevant env.." - rlPhaseEnd - rlJournalPrintText - rlJournalEnd - exit 0 - fi - - if test -f $PROCFILE; then - -# This can easily be tested with strace. Just cycle through the settings: - # 0 - Default attach security permissions. # 1 - Restricted attach. Only child processes plus normal permissions. # 2 - Admin-only attach. Only executables with CAP_SYS_PTRACE. @@ -65,18 +53,17 @@ rlJournalStart # echo 0 > /proc/sys/kernel/yama/ptrace_scope # With 0, strace works against any process with your uid. For example, strace -p 2190. -# With 1, strace errors when doing the same as in 0: strace: attach: ptrace(PTRACE_SEIZE, 3180): Operation not permitted. However, you can strace any program you run from strace, "strace /bin/ls" or example. +# With 1, strace errors when doing the same as in 0: strace: attach: ptrace(PTRACE_SEIZE, 3180): +# Operation not permitted. However, you can strace any program you run from strace, +# "strace /bin/ls" or example. # With 2, you can only strace from the root account. You can no longer strace commands run from strace. # With 3, even root cannot strace. -# --- - -# possible related AVCs tracked as https://bugzilla.redhat.com/show_bug.cgi?id=1458999 - -# --- - rlRun "useradd $MY_USER" 0,9 + rlRun "cp -f ptrace-scope-test.sh /tmp/" + rlRun "chmod -f a+x /tmp/ptrace-scope-test.sh" + rlRun "ORIGVAL=$( cat $PROCFILE )" # First, test the default behaviour, which is "no restriction" @@ -109,13 +96,6 @@ rlJournalStart # set the default yama policy as such. rlRun "echo $ORIGVAL > $PROCFILE" - - else - # Yama had been enabled in rhel-7.4 kernel within - # dist-git commit 9f3dff2c9ce3a6607c6342fc00b8fc82c6167ec6 - # which is kernel-3.10.0-677.el7. - rlLogInfo "Not a YAMA enabled kernel" - fi rlPhaseEnd rlJournalPrintText rlJournalEnd From aa12d8e74b8cadb1aeb1afe2584476feeb8a360f Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 22 2021 15:36:50 +0000 Subject: [PATCH 5/9] [citest] --- diff --git a/tests/Regression/rpmtests/runtest.sh b/tests/Regression/rpmtests/runtest.sh index 88fcae8..79f4a46 100755 --- a/tests/Regression/rpmtests/runtest.sh +++ b/tests/Regression/rpmtests/runtest.sh @@ -67,3 +67,5 @@ rlJournalStart rlPhaseEnd rlJournalPrintText rlJournalEnd + + From d6dc45ced9c8acdf048d97c09cbbda56a20feb9c Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 22 2021 18:24:58 +0000 Subject: [PATCH 6/9] Debuginfod: nicely stop and clean up. --- diff --git a/tests/Sanity/elfutils-debuginfod/body.sh b/tests/Sanity/elfutils-debuginfod/body.sh index fa91438..0b25ad0 100755 --- a/tests/Sanity/elfutils-debuginfod/body.sh +++ b/tests/Sanity/elfutils-debuginfod/body.sh @@ -66,8 +66,11 @@ sleep $DELAY # Try to find the debug file with the known buildid debuginfod-find debuginfo 17ea386087f263827e0cb57fd0d888feb3035d3d -# Clean up -rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache +# Stop the service +systemctl stop debuginfod # Kill the logger -kill $logger +kill -HUP $logger + +# Clean up +rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache From f50c971fea63e88e95fb87670d0cffeaa9486817 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 23 2021 06:55:15 +0000 Subject: [PATCH 7/9] Another attempt to avoid stall in Sanity/elfutils-debuginfod. --- diff --git a/tests/Sanity/elfutils-debuginfod/body.sh b/tests/Sanity/elfutils-debuginfod/body.sh index 0b25ad0..f5acccb 100755 --- a/tests/Sanity/elfutils-debuginfod/body.sh +++ b/tests/Sanity/elfutils-debuginfod/body.sh @@ -6,8 +6,8 @@ set -xeo pipefail systemctl stop debuginfod rm -rf ~/.cache/debuginfod_client rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache -journalctl -g debuginfod -f & -logger=$! +# journalctl -g debuginfod -f & +# logger=$! # Set up a delay. A delay of 3 worked for me reliably for manual testing. @@ -70,7 +70,10 @@ debuginfod-find debuginfo 17ea386087f263827e0cb57fd0d888feb3035d3d systemctl stop debuginfod # Kill the logger -kill -HUP $logger +# kill -HUP $logger # Clean up rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache + +pstree -p $$ +wait diff --git a/tests/Sanity/elfutils-debuginfod/runtest.sh b/tests/Sanity/elfutils-debuginfod/runtest.sh index ef53fc9..ea5978f 100755 --- a/tests/Sanity/elfutils-debuginfod/runtest.sh +++ b/tests/Sanity/elfutils-debuginfod/runtest.sh @@ -61,6 +61,8 @@ rlJournalStart rlFileRestore rlRun "popd" rlRun "rm -r $TMPD" + rlRun "pstree -p $$" + wait rlPhaseEnd rlJournalPrintText rlJournalEnd From d71e0023c38793aadc66b3568503e36457a34886 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 23 2021 13:44:52 +0000 Subject: [PATCH 8/9] Try to fix Sanity/elfutils-debuginfod and Regression/bz652858-elfutils-prelink-stap-interaction --- diff --git a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh index 020e519..995122d 100755 --- a/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh +++ b/tests/Regression/bz652858-elfutils-prelink-stap-interaction/runtest.sh @@ -34,6 +34,8 @@ PACKAGE="$( rpm -qf --queryformat='%{name}\n' `which eu-strip` )" # work around https://github.com/psss/tmt/issues/624 dnf debuginfo-install -y coreutils findutils gcc gcc-c++ libstdc++ kernel-devel ||: stap-prep ||: +export DEBUGINFOD_URLS="https://debuginfod.elfutils.org/ $DEBUGINFOD_URLS" + rlJournalStart rlPhaseStartSetup diff --git a/tests/Sanity/elfutils-debuginfod/body.sh b/tests/Sanity/elfutils-debuginfod/body.sh index f5acccb..ce45ef3 100755 --- a/tests/Sanity/elfutils-debuginfod/body.sh +++ b/tests/Sanity/elfutils-debuginfod/body.sh @@ -6,9 +6,8 @@ set -xeo pipefail systemctl stop debuginfod rm -rf ~/.cache/debuginfod_client rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache -# journalctl -g debuginfod -f & -# logger=$! +STARTTIME=$(date '+%Y-%m-%d %H:%M') # Set up a delay. A delay of 3 worked for me reliably for manual testing. DELAY=120 @@ -71,6 +70,9 @@ systemctl stop debuginfod # Kill the logger # kill -HUP $logger +echo '======= vvvvvvv ======= LOG ======= vvvvvvv =======' +journalctl -g debuginfod -S "$STARTTIME" +echo '======= ^^^^^^^ ======= LOG ======= ^^^^^^^ =======' # Clean up rm -rf /usr/src/my_extra_rpms $HOME/.debuginfod_client_cache From 042048329b203b865c5de356c4a1288788a587c0 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Mar 24 2021 08:32:36 +0000 Subject: [PATCH 9/9] Disable Sanity/elfutils-debuginfod temporarily --- diff --git a/tests/Sanity/elfutils-debuginfod/main.fmf b/tests/Sanity/elfutils-debuginfod/main.fmf index 4b43ee8..ecb8152 100644 --- a/tests/Sanity/elfutils-debuginfod/main.fmf +++ b/tests/Sanity/elfutils-debuginfod/main.fmf @@ -13,3 +13,6 @@ recommend: duration: 48h extra-summary: /tools/elfutils/Sanity/elfutils-debuginfod extra-task: /tools/elfutils/Sanity/elfutils-debuginfod +# fails in rawhide ci infrastructure although locally works +# investigation in progress +enabled: false