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/elfutils.spec b/elfutils.spec index 783c8c4..28460d3 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.183 -%global baserelease 2 +%global baserelease 3 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -409,6 +409,9 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Mon Apr 19 2021 Mark Wielaard - 0.183-3 +- Introduce CI gating setup + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.183-2 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4fab4ec --- /dev/null +++ b/gating.yaml @@ -0,0 +1,13 @@ +--- !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} +--- !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/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/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-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/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/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..3829217 --- /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: no" >> $(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..1dd17ca --- /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: no" >> $(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..47c2e7b --- /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: no" >> $(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..0f8e722 --- /dev/null +++ b/tests/Security/bz1139128-CVE-2014-0172-elfutils-integer-overflow/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/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 +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