annocheck man page
annocheck — Analysing an application's compilation.
The annocheck program can analyse programs and report information about them. It is designed to be modular, with a set of self-contained tools providing the checking functionality. Currently the following tools are implemented:
The annocheck program is able to scan inside rpm files and libraries. It will automatically recurse into any directories that are specified on the command line. In addition annocheck knows how to find debug information held in separate debug files, and it will search for these whenever it is checking debug information.
The program supports some generic command line options that are used regardless of which tools are enabled.
Look in file for separate dwarf debug information.
Look in dir for separate dwarf debug information files.
Display this message & exit.
Do not complain about unknown file types.
Include text in the output description.
Do not print anything, just return an exit status.
Produce informational messages whilst working. Repeat for more information.
Report the version of the tool and then exit.
"hardened" tool checks that the specified files were compiled with the required security hardening options, as outlined in the elf-policy document. It runs a series of tests checking compilation options and link time options. These tests are outlined below, along with the command line option that can be used to disable each test.
Lazy binding must not have been enabled via the linker option -z now. Disabled by --skip-bind-now.
- "Non executable stack"
The program must not have a stack in an executable region of memory. Disabled by --skip-gnu-stack.
- "Safe GOT relocations"
The relocations for the GOT table must be read only. Disabled by --skip-writeable-got.
- "No WX segments."
No program segment should have all three of the read, write and execute permission bits set. Disabled by --skip-rwx-seg.
- "No text relocations"
The should be no relocations against executable code. Disabled by --skip-textrel.
- "Correct runpaths"
The runpath information used to locate shared libraries at runtime must only include directories rooted at /usr. Disabled by --skip-run-path.
- "Missing annobin data"
The program must have been compiled with annobin notes enabled. Disabled by --ignore-gaps.
- "Strong stack protection"
The program must have been compiled with the -fstack-protector-strong option enabled, and with -D_FORTIFY_SOURCE=2 specified. It must also have been compiled at at least optimization level 2. Disabled by --skip-stack-prot.
- "Dynamic data present"
Dynamic executables must have a dynamic segment. Disabled by --skip-dynamic-segment.
- "Position Independent compilation"
Shared libraries must have been compiled with -fPIE and dynamic executables must have been compiled with -fPIC. Disabled by --skip-pic.
- "Safe exceptions"
Program which use exception handling must have been compiled with -fexceptions enabled and with -D_GLIBCXX_ASSERTIONS specified. Disabled by --skip-threads and/or --skip-glibcxx-assertions.
- "Stack Clash protection"
If available the -fstack-clash-protection must have been used. Disabled by --skip-stack-clash.
- "Control Flow protection"
If available the -fcf-protection=full must have been used. Disabled by --skip-cf-protection.
- "Stack realignment"
For i686 binaries, the -mstackrealign option must have been specified. Disabled by --skip-stack-realign.
- "Source fortification"
The program must have been compiled with the -D_FORTIFY_SOURCE=2 command line option specified. Disabled by --skip-fortify.
The program must have been compiled with at least -O2 optimization enabled. Disabled by --skip-optimization.
- "Read only relocations"
The program must not have any relocations that are held in a writeable section. Disabled by --skip-gnu-relro.
The tool does support a couple of other command line options as well:
Enable the tool if it was previously disabled.
Disable the tool.
The built-by tool is disabled by default, but it can be enabled by the command line option --enable-builtby. The tool checks the specified files to see if any information is stored about how the file was built.
The tool supports a few command line options to customise its behaviour:
Report all builder identification strings. The tool has several different heuristics for determining the builder. By default it will report the information return by the first successful heuristic. If the --all option is enabled then all successful results will be returned.
This option can be used to restrict the output to only those files which were built by a specific tool. This can be useful when scanning a directory full of files searching for those built by a particular compiler.
This option can be used to restrict the output to only those files which were not built by a specific tool. This can be useful when scanning a directory full of files searching for those that were not built by a particular compiler.
Copyright (c) 2018 Red Hat.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".