Compare commits

...
Sign in to create a new pull request.

23 commits

Author SHA1 Message Date
Nick Clifton
ac0565bd9b Annocheck: Improve heuristic for skipping LTO and FORTIFY tests. (#2264000) 2024-02-13 10:53:48 +00:00
Nick Clifton
37dbe3d499 Annocheck: Also skip property note test for i686 binaries. (#2258571) 2024-02-09 19:47:33 +00:00
Nick Clifton
d85ddc005e Annocheck: Also skip the entry point test for i686 binaries. (#2258571)
GCC Plugin: Do not use section groups with string format notes.
2024-01-23 15:17:04 +00:00
Nick Clifton
fe2e52bd89 Annocheck: Disable cf-protection test for i686 architecture. (#2258571) 2024-01-16 11:47:17 +00:00
Nick Clifton
45c1b98537 Annocheck: Improve detection of FIPS compliant GO binaries.
GCC Plugin: Fix recording of the -Wimplicit-int and -Wimplicit-function-declaration warnings.
Add active checks for when they are deliberately disabled.
Tests: Fix implicit-values test so that it will compile with gcc 14+.
GCC Plugin: Add support for -fhardended. - Update glibc detection heuristics for PPC64.  (RHEL-16453)
2024-01-04 15:12:32 +00:00
Nick Clifton
ef781616c5 Fix another atexit test failure. (#2247481)
Fix atexit test failure.
Notes: Add support for string format notes.
2023-11-06 16:34:57 +00:00
Yara Ahmad
ec516e5e0a - GCC Plugin: Record settings of -Wstrict-flex-arrays and -fstrict-flex-arrays
- Annobin: Add future test of these options.
2023-10-10 11:33:29 +02:00
Yara Ahmad
bae101100c - GCC Plugin: Record settings of -Wimplicit-int and -Wimplicit-function-declaration. 2023-10-02 13:42:33 +02:00
Yara Ahmad
097b0db8ff - LLVM Plugin: Fix building with LLVM version 17.
- GCC Plugin: Enable string note format by default.
- Annocheck: Change GO FIPS test to look for CGO_ENABLED markers.
2023-09-14 13:22:06 +02:00
Yara Ahmad
201159979b - Annocheck: Add test for FIPS compliant GO binaries.
- Annocheck: Fix double free.  (#2226749)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
- Spec File: migrated to SPDX license.  (#2222112)
2023-08-01 11:30:22 +02:00
Václav Kadlčík
ec61de605c Move downstream tests to a separate repository
The tests have been moved to
  https://src.fedoraproject.org/tests/annobin
The move will enable more flexible downstream usage, namely
in RHEL testing.
2023-07-26 10:48:55 +00:00
Yara Ahmad
5bd179bd21 - Spec File: Change License field to use SPDX notation. (#2222112)
- Annocheck: Ignore AArch64  and  symbols.  (#2221192)
2023-07-18 10:31:58 +02:00
Yara Ahmad
6206d10a84 - GCC Plugin: Suppress active checks for fortran sources. Improve scanning of COLLECT_GCC_OPTIONS.
- Annocheck: Remove dependency upon binutils-devel.
- Annocheck: Add detection of known parts of libstdc++-nonshared.a that contain gaps.  (#2217864)
- Annocheck: Ignore weak/undef function symbols when checking to see if a binary contains code.  (#2217840)
- Annocheck: Add --suppress-version-warnings option.
2023-07-10 15:49:21 +02:00
Yara Ahmad
e7afc85775 - Annocheck: Do not ignore separate debuginfo files that do not contain any DWARF. (#2144553)
- Annocheck: Ignore /dev/null filename in string notes.
- Annocheck: More tweaks to glibc detection heuristics.  (#2215968)
2023-06-23 14:54:37 +02:00
Yara Ahmad
8252e9a685 - Annocheck: Check for string notes in separate debug info files. (#2211694)
- Annocheck: Add support for el10 and rhel-10 profiles.  (RHEL-526)
- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19)
2023-06-05 15:57:02 +02:00
yahmad
444d67f7f2 - Annocheck: Suppress more tests for Rust binaries.
- Annocheck: Fix detection of missing plugin options.  (#2189492)
- Fix generation of auto-generated files.
- Fix covscan reported errors.
- gcc-plugin: generate warnings about misspelt -D_FORTIFY_SOURCE and/or -D_GLIBCXX_ASSERTIONS options.
- gcc-plugin: use a bigger buffer for constructing notes.
- llvm-plugin: Fix detection of optimization level.  Improve test.
- clang-plugin: Improve test.
- configure: More improvements.
- annocheck: Fix seg-fault when checking for glibc components in string format notes.
- configure: Simplify.
2023-05-02 17:43:14 +02:00
yahmad
6ac06851bc - gcc plugin: Add filenames to string notes. Allow use of ANNOBIN environment variable.
- llvm plugin: Add workaround for building with LLVM-16.
- clang plugin: Fix for building with Clang-16.
2023-04-12 15:52:28 +02:00
yahmad
f65de8f709 - gcc plugin: Keep ELF notes at protocol version 3. 2023-03-30 14:15:17 +02:00
yahmad
34271c05b2 - Protocol Version 4: String format notes. 2023-03-29 18:17:09 +02:00
yahmad
1f1563847a - Annocheck: Update message for LTO tests. (#2177140)
- Annocheck: Add even more code to handle another glibc function built without LTO.
- Annocheck: Add code to handle another glibc function built without LTO.
2023-03-21 09:20:01 +01:00
yahmad
1d9177dfb2 Fix a typo in the sources file 2023-02-28 19:04:05 +01:00
yahmad
6c8bb786f1 - GCC Plugin: Do not run if other plugins are active. (#2162746)
- Annocheck: Add code to handle glibc functions built without LTO.
2023-02-28 18:26:10 +01:00
Václav Kadlčík
9dc3bf4069 Remove an obsoleted option from the CI plan
TMT has obsoleted the "directory" option. We do not need to replace it
with anything, the discovery phase works still the same way.
2023-02-27 09:46:49 +01:00
30 changed files with 118 additions and 703 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/annobin-*.tar.xz
/annobin-9.51-1.fc34.src.rpm
/annobin-11.11-1.fc38.src.rpm

View file

@ -1,9 +1,9 @@
Name: annobin
Summary: Annotate and examine compiled binary files
Version: 11.09
Version: 12.40
Release: 1%{?dist}
License: GPLv3+
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later
URL: https://sourceware.org/annobin/
# Maintainer: nickc@redhat.com
# Web Page: https://sourceware.org/annobin/
@ -67,7 +67,7 @@ Source: https://nickc.fedorapeople.org/%{annobin_sources}
%global annobin_source_dir %{_usrsrc}/annobin
# Insert patches here, if needed. Eg:
# Patch01: annobin-foo.patch
# Patch01: annobin-plugin-default-string-notes.patch
#---------------------------------------------------------------------------------
@ -139,17 +139,15 @@ Provides the documentation files and example shell scripts for use with annobin.
%package tests
Summary: Test scripts and binaries for checking the behaviour and output of the annobin plugin
Requires: %{name}-docs = %{version}-%{release}
BuildRequires: make sharutils
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
%description tests
Provides a means to test the generation of annotated binaries and the parsing
of the resulting files.
BuildRequires: make
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
%endif
#----------------------------------------------------------------------------
@ -158,7 +156,7 @@ BuildRequires: elfutils-debuginfod-client-devel
%package annocheck
Summary: A tool for checking the security hardening status of binaries
BuildRequires: gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel binutils-devel make
BuildRequires: gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
@ -175,14 +173,13 @@ hardening options.
%package libannocheck
Summary: A library for checking the security hardening status of binaries
BuildRequires: gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel binutils-devel make
BuildRequires: gcc elfutils elfutils-devel elfutils-libelf-devel rpm-devel make
%if %{with debuginfod}
BuildRequires: elfutils-debuginfod-client-devel
%endif
Requires: %{name}-docs = %{version}-%{release}
Requires: binutils-devel
%description libannocheck
Installs the libannocheck library which uses the notes generated by the
@ -464,12 +461,17 @@ rm -f %{buildroot}%{_infodir}/dir
%if %{with tests}
%check
# Change the following line to "make check || :" on RHEL7 or if you need to see the
# test suite logs in order to diagnose a test failure.
make check
# The first "make check" is run with "|| :" so that we can capture any logs
# from failed tests. The second "make check" is there so that the build
# will fail if any of the tests fail.
make check || :
if [ -f tests/test-suite.log ]; then
cat tests/test-suite.log
fi
# If necessary use uuencode to preserve test binaries here. For example:
# uuencode tests/tmp_atexit/atexit.strip atexit.strip
make check
%endif
#---------------------------------------------------------------------------------
@ -522,6 +524,104 @@ fi
#---------------------------------------------------------------------------------
%changelog
* Tue Feb 13 2024 Nick Clifron <nickc@redhat.com> - 12.40-1
- Annocheck: Improve heuristic for skipping LTO and FORTIFY tests. (#2264000)
* Fri Feb 09 2024 Nick Clifron <nickc@redhat.com> - 12.39-1
- Annocheck: Also skip property note test for i686 binaries. (#2258571)
* Tue Jan 23 2024 Nick Clifron <nickc@redhat.com> - 12.38-1
- Annocheck: Also skip the entry point test for i686 binaries. (#2258571)
- GCC Plugin: Do not use section groups with string format notes.
* Tue Jan 16 2024 Songsong Zhang <U2FsdGVkX1@gmail.com> - 12.36-1
- Annocheck: Disable cf-protection test for i686 architecture. (#2258571)
* Thu Jan 04 2024 Nick Clifron <nickc@redhat.com> - 12.35-1
- Annocheck: Improve detection of FIPS compliant GO binaries.
- GCC Plugin: Fix recording of the -Wimplicit-int and -Wimplicit-function-declaration warnings. Add active checks for when they are deliberately disabled.
- Tests: Fix implicit-values test so that it will compile with gcc 14+.
- GCC Plugin: Add support for -fhardended.
- Update glibc detection heuristics for PPC64. (RHEL-16453)
* Mon Nov 06 2023 Nick Clifron <nickc@redhat.com> - 12.30-1
- Fix another atexit test failure. (#2247481)
- Fix atexit test failure.
- Notes: Add support for string format notes.
* Tue Oct 10 2023 Yara Ahmad <yahmad@redhat.com> - 12.28-1
- GCC Plugin: Record settings of -Wstrict-flex-arrays and -fstrict-flex-arrays
- Annobin: Add future test of these options.
* Mon Oct 02 2023 Yara Ahmad <yahmad@redhat.com> - 12.27-1
- GCC Plugin: Record settings of -Wimplicit-int and -Wimplicit-function-declaration.
- Annobin: Add test for these warnings.
* Thu Sep 14 2023 Yara Ahmad <yahmad@redhat.com> - 12.26-1
- LLVM Plugin: Fix building with LLVM version 17.
- GCC Plugin: Enable string note format by default.
- Annocheck: Change GO FIPS test to look for CGO_ENABLED markers.
* Tue Aug 01 2023 Yara Ahmad <yahmad@redhat.com> - 12.23-1
- Annocheck: Add test for FIPS compliant GO binaries.
- Annocheck: Fix double free. (#2226749)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
- Spec File: migrated to SPDX license. (#2222112)
* Tue Jul 18 2023 Yara Ahmad <yahmad@redhat.com> - 12.20-2
- Spec File: Change License field to use SPDX notation. (#2222112)
- Annocheck: Ignore AArch64 $x and $d symbols. (#2221192)
* Mon Jul 10 2023 Yara Ahmad <yahmad@redhat.com> - 12.19-1
- GCC Plugin: Suppress active checks for fortran sources. Improve scanning of COLLECT_GCC_OPTIONS.
- Annocheck: Remove dependency upon binutils-devel.
- Annocheck: Add detection of known parts of libstdc++-nonshared.a that contain gaps. (#2217864)
- Annocheck: Ignore weak/undef function symbols when checking to see if a binary contains code. (#2217840)
- Annocheck: Add --suppress-version-warnings option.
* Fri Jun 23 2023 Yara Ahmad <yahmad@redhat.com> - 12.14-1
- Annocheck: Do not ignore separate debuginfo files that do not contain any DWARF. (#2144553)
- Annocheck: Ignore /dev/null filename in string notes.
- Annocheck: More tweaks to glibc detection heuristics. (#2215968)
* Mon Jun 05 2023 Yara Ahmad <yahmad@redhat.com> - 12.12-1
- Annocheck: Check for string notes in separate debug info files. (#2211694)
- Annocheck: Add support for el10 and rhel-10 profiles. (RHEL-526)
- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19)
* Tue May 02 2023 Yara Ahmad <yahmad@redhat.com> - 12.10-1
- Annocheck: Suppress more tests for Rust binaries.
- Annocheck: Fix detection of missing plugin options. (#2189492)
- Fix generation of auto-generated files.
- Fix covscan reported errors.
- gcc-plugin: generate warnings about misspelt -D_FORTIFY_SOURCE and/or -D_GLIBCXX_ASSERTIONS options.
- gcc-plugin: use a bigger buffer for constructing notes.
- llvm-plugin: Fix detection of optimization level. Improve test.
- clang-plugin: Improve test.
- configure: More improvements.
- annocheck: Fix seg-fault when checking for glibc components in string format notes.
- configure: Simplify.
* Wed Apr 12 2023 Yara Ahmad <yahmad@redhat.com> - 12.02-1
- gcc plugin: Add filenames to string notes. Allow use of ANNOBIN environment variable.
- llvm plugin: Add workaround for building with LLVM-16.
- clang plugin: Fix for building with Clang-16.
* Thu Mar 30 2023 Yara Ahmad <yahmad@redhat.com> - 12.01-1
- gcc plugin: Keep ELF notes at protocol version 3.
* Wed Mar 29 2023 Yara Ahmad <yahmad@redhat.com> - 12.00-1
- Protocol Version 4: String format notes.
* Tue Mar 21 2023 Yara Ahmad <yahmad@redhat.com> - 11.14-1
- Annocheck: Update message for LTO tests. (#2177140)
- Annocheck: Add even more code to handle another glibc function built without LTO.
- Annocheck: Add code to handle another glibc function built without LTO.
* Tue Feb 28 2023 Yara Ahmad <yahmad@redhat.com> - 11.11-1
- GCC Plugin: Do not run if other plugins are active. (#2162746)
- Annocheck: Add code to handle glibc functions built without LTO.
* Thu Feb 02 2023 Nick Clifton <nickc@redhat.com> - 11.09-1
- Libannocheck: Fix thinko in debugging code.
- Annocheck: Fix LTO test.

View file

@ -1,6 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
url: https://src.fedoraproject.org/tests/annobin.git
execute:
how: tmt

View file

@ -1 +1 @@
SHA512 (annobin-11.09.tar.xz) = 41bf99d07110630f5b8773eb1e83d3d7c1355dae531d66f66721d45b06d9e0da01b447e5279480d62516303fdce6b9d0f1c8e8f6d541c42a590ce97b6c79f996
SHA512 (annobin-12.40.tar.xz) = f6219711771d2b84fb5b7afbcbd34a4e1901119ba2dcedb8817ec6b039813dec9b7f1194bd4f71ba802a1c32502f8fd9b995cef20e4724bbcd42516927a7aa0c

View file

@ -1,2 +0,0 @@
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
for backward compatibility with traditional beakerlib test harness in RHEL.

View file

@ -1,18 +0,0 @@
summary: Test for BZ#1958954 (annobin fails to skip endbr64 entry point check)
description: |
Bug summary: annobin fails to skip endbr64 entry point check for shared objects
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1958954
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-annocheck
- annobin-plugin-gcc
- gcc
- redhat-rpm-config
duration: 48h
extra-summary: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check
extra-task: /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check

View file

@ -1,51 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/annobin-fails-to-skip-endbr64-entry-point-check
# Description: Test for BZ#1958954 (annobin fails to skip endbr64 entry point check)
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 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 "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "echo 'void f1(void) {}' > f1.c"
rlRun "echo 'void f2(void) {}' > f2.c"
rlRun "gcc `rpm --eval %build_cflags` -fpic -c f1.c"
rlRun "gcc `rpm --eval %build_cflags` -fpic -c f2.c"
rlRun "gcc `rpm --eval %build_ldflags` -shared f1.o f2.o"
rlRun "annocheck -v --skip-lto a.out"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,14 +0,0 @@
summary: identify
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- annobin-plugin-gcc
- annobin-annocheck
duration: 48h
extra-summary: /tools/annobin/Regression/identify
extra-task: /tools/annobin/Regression/identify

View file

@ -1,43 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/identify
# Description: identify
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "tool_v=$(annocheck --version | awk '/^annocheck: Version/ {print $3}')"
rlRun "__RPM=$(rpm --queryformat='%{name}\n' -qf $(man -w annobin))"
rlRun "rpm_v=$(rpm -q --queryformat='%{version}\n' $__RPM)"
# Following fails for annobin-8.89-2.el8
rlRun "[[ "x${tool_v}" == "x${rpm_v}." ]]"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,17 +0,0 @@
summary: lto-preprocessor-options
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-plugin-gcc
- annobin-annocheck
- redhat-rpm-config
- gcc
- redhat-rpm-config
duration: 48h
extra-summary: /tools/annobin/Regression/lto-preprocessor-options
extra-task: /tools/annobin/Regression/lto-preprocessor-options

View file

@ -1,44 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/lto-preprocessor-options
# Description: lto-preprocessor-options
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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="annobin"
rlJournalStart
rlPhaseStartTest
b=`mktemp`
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "cflags=\"$(rpm --eval '%build_cflags')\""
rlRun "ldflags=\"$(rpm --eval '%build_ldflags')\""
rlRun "echo 'int main (void) { return 0; }' | gcc -xc -o $b $cflags $ldflags -flto - "
rlRun "annocheck -v $b"
rm $b
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,16 +0,0 @@
summary: missing-check-for-x86-property-note-content
description: |
Bug summary: annobin: Missing check for contents of x86 property note
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1991931
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-annocheck
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1991931
extra-summary: /tools/annobin/Regression/missing-check-for-x86-property-note-content
extra-task: /tools/annobin/Regression/missing-check-for-x86-property-note-content

View file

@ -1,40 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/missing-check-for-x86-property-note-content
# Description: missing-check-for-x86-property-note-content
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 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="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "annocheck main" 1
rlRun "annocheck --fixed-format-messages main | \
grep '^Hardened: FAIL: test: cf-protection file: main.$'"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,16 +0,0 @@
summary: processing-params-in-reverse-order
description: |
Bug summary: annocheck processes (reports) parameters in reverse order
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988714
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-annocheck
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988714
extra-summary: /tools/annobin/Regression/processing-params-in-reverse-order
extra-task: /tools/annobin/Regression/processing-params-in-reverse-order

View file

@ -1,42 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/processing-params-in-reverse-order
# Description: processing-params-in-reverse-order
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 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="annobin"
rlJournalStart
rlPhaseStartTest
rlRun "TMP=$(mktemp)"
rlRun "annocheck --verbose --skip-all --test-stack-prot /bin/bash /bin/cat |& tee $TMP"
rlRun "fgrep -i /bin/ $TMP | head -1 | fgrep /bash"
rlRun "fgrep -i /bin/ $TMP | tail -1 | fgrep /cat"
rlRun "rm -f $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,18 +0,0 @@
summary: segv-when-processing-multiple-params-incl-symlink
description: |
Bug summary: annocheck segfaults sometimes when processing multiple parameters and symlink is involved
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988715
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-plugin-gcc
- annobin-annocheck
- libstdc++
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988715
extra-summary: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink
extra-task: /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink

View file

@ -1,44 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/segv-when-processing-multiple-params-incl-symlink
# Description: segv-when-processing-multiple-params-incl-symlink
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 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="annobin"
rlJournalStart
rlPhaseStartTest
# This tries to test https://bugzilla.redhat.com/show_bug.cgi?id=1988715#c0
# keeping in mind that annocheck will evolve in the future, along its
# rules / policies, and the surrounding OS will evolve too. This test
# shouldn't report false positives though.
rlRun "rpm -qf /usr/lib64/libstdc++.so*"
rlRun "annocheck --follow-links --skip-all /usr/lib64/libstdc++.so*"
rlRun "annocheck --ignore-links --skip-all /usr/lib64/libstdc++.so*"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,24 +0,0 @@
summary: testsuite
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-plugin-gcc
- annobin-annocheck
- binutils-devel
- bzip2-devel
- dnf
- elfutils
- elfutils-devel
- gcc-c++
- gcc-plugin-devel
- make
- rpm-build
- rpm-devel
duration: 48h
extra-summary: /tools/annobin/Regression/testsuite
extra-task: /tools/annobin/Regression/testsuite

View file

@ -1,85 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Regression/testsuite
# Description: testsuite
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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="${PACKAGE:-$(rpm -qf --queryformat=%{name} $(man -w annobin))}"
export PACKAGE
GCC="${GCC:-$(which gcc)}"
rlJournalStart
rlPhaseStartSetup
rlLogInfo "PACKAGES=$PACKAGES"
rlLogInfo "REQUIRES=$REQUIRES"
rlLogInfo "COLLECTIONS=$COLLECTIONS"
rlLogInfo "X_SCLS=$X_SCLS"
rlLogInfo "GCC=$GCC"
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
# In case more than one devtoolset- or gcc-toolset -build package is
# installed (they can co-exist from the packaging persp, but their
# coexistence causes unexpected results with rpm macros), then we have
# a mess of defined rpm macros coming e.g. from
# /etc/rpm/macros.gcc-toolset-10-config
# /etc/rpm/macros.gcc-toolset-9-config etc. To have just the needed
# macros (respective to given SCL under test) defined without
# uninstalling unneeded RPMs, we'll need an override mechanism. The
# following assumes just one SCL *enabled* (more than one installed),
# and doesn't care of a (useless) revert:
echo ${X_SCLS} | fgrep toolset && \
rlRun "cat /etc/rpm/*${X_SCLS%\ }* > ~/.rpmmacros"
rlAssertRpm $PACKAGE
rlRun "TMP=\$(mktemp -d)"
rlRun "pushd $TMP"
rlFetchSrcForInstalled $PACKAGE
rlRun "dnf builddep -y *src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec"
rlPhaseEnd
rlPhaseStartTest
rlRun "pushd BUILD/annobin-*"
set -o pipefail
rlRun "make check |& tee $TMP/check.log"
rlRun -l "grep '^PASS:' $TMP/check.log" 0
rlRun -l "grep '^FAIL:' $TMP/check.log" 1
PASSCOUNT=$(grep '^PASS:' $TMP/check.log | wc -l)
rlRun "[[ $PASSCOUNT -ge 7 ]]"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,17 +0,0 @@
summary: Test for BZ#1973981 (annocheck silently ignores any file parameter)
description: |
Bug summary: annocheck silently ignores any file parameter beyond 256
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1973981
contact: Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-plugin-gcc
- annobin-annocheck
duration: 48h
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1973981
extra-summary: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter
extra-task: /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter

View file

@ -1,55 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Sanity/annocheck-silently-ignores-any-file-parameter
# Description: Test for BZ#1973981 (annocheck silently ignores any file parameter)
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "TMP=$(mktemp -d)"
rlRun "pushd $TMP"
rlPhaseEnd
rlPhaseStartTest
for i in `seq 0 299`; do touch ${i}.sample; done
samplecnt=$(ls *.sample | wc -l)
testcnt=$(ls *.sample | \
xargs annocheck |& \
grep -F \
-e '.sample: unable to read magic number' \
-e '.sample: is not an ELF format file' \
| wc -l)
rlRun "test $samplecnt -eq 300"
rlRun "test $testcnt -eq 300"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,5 +0,0 @@
#include <stdio.h>
void hello() {
printf("Hello World\n");
}

View file

@ -1,5 +0,0 @@
#include <iostream>
void hello() {
std::cout << "Hello World\n";
}

View file

@ -1,6 +0,0 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View file

@ -1,6 +0,0 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View file

@ -1,17 +0,0 @@
summary: gcc-fedora-flags
description: ''
contact:
- Tom Stellard <tstellar@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- gcc-c++
- annobin
- annobin-annocheck
- redhat-rpm-config
duration: 1h
extra-summary: /tools/annobin/Sanity/gcc-fedora-flags
extra-task: /tools/annobin/Sanity/gcc-fedora-flags

View file

@ -1,40 +0,0 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
set -x
default_cflags=`rpm -E %{build_cflags}`
default_cxxflags=`rpm -E %{build_cxxflags}`
default_ldflags=`rpm -E %{build_ldflags}`
cflags=`rpm -D '%toolchain gcc' -E %{build_cflags}`
cxxflags=`rpm -D '%toolchain gcc' -E %{build_cxxflags}`
ldflags=`rpm -D '%toolchain gcc' -E %{build_ldflags}`
set +x
rlJournalStart
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "test \"$default_cflags\" = \"$cflags\""
rlRun "test \"$default_cxxflags\" = \"$cxxflags\""
rlRun "test \"$default_ldflags\" = \"$ldflags\""
rlRun "gcc $cflags -o hello.o -c hello.c"
rlRun "annocheck hello.o"
rlRun "gcc $cflags -o main.o -c main.c"
rlRun "gcc $ldflags -o hello main.o hello.o"
rlRun "annocheck hello"
rlRun "./hello | grep \"Hello World\""
rlRun "g++ $cxxflags -o hello-cpp.o -c hello.cpp"
rlRun "annocheck hello-cpp.o"
rlRun "g++ $cxxflags -o main-cpp.o -c main.cpp"
rlRun "g++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o"
rlRun "annocheck hello-cpp"
rlRun "./hello-cpp | grep \"Hello World\""
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,16 +0,0 @@
summary: smoke test for annobin plugin
description: ''
contact:
- Martin Cermak <mcermak@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
require:
- annobin-plugin-gcc
- annobin-annocheck
- man-db
- gcc
duration: 48h
extra-summary: /tools/annobin/Sanity/smoke
extra-task: /tools/annobin/Sanity/smoke

View file

@ -1,45 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/annobin/Sanity/smoke
# Description: smoke test for annobin plugin
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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="annobin"
rlJournalStart
rlPhaseStartSetup
rlRun "which gcc"
rlRun "man -w annobin"
rlRun "echo $X_SCLS"
rlPhaseEnd
rlPhaseStartTest
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
rlRun "echo 'int main() {return 0;}' | gcc -xc -fplugin=annobin -o /dev/null -"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd