Hardening checker basics
The hardening checker is enabled by default. You can disable the hardening checker by using the --disable-hardened command-line option.
Hardening checker options Copy linkLink copied!
Copy linkLink copied!
The annocheck tool verifies binaries for various hardening options, such as stack protection, PIC/PIE usage, and secure linker settings.
The following options are checked:
- Lazy binding is disabled using the
-z nowlinker option. - The program does not have a stack in an executable region of memory.
- The relocations for the GOT table are set to read only.
- No program segment has all three of the read, write and execute permission bits set.
- There are no relocations against executable code.
- The runpath information for locating shared libraries at runtime includes only directories rooted at /usr.
- The program was compiled with
annobinnotes enabled. - The program was compiled with the
-fstack-protector-strongoption enabled. - The program was compiled with
-D_FORTIFY_SOURCE=2. - The program was compiled with
-D_GLIBCXX_ASSERTIONS. - The program was compiled with
-fexceptionsenabled. - The program was compiled with
-fstack-clash-protectionenabled. - The program was compiled at
-O2or higher. - The program does not have any relocations held in a writeable.
- Dynamic executables have a dynamic segment.
- Shared libraries were compiled with
-fPICor-fPIE. - Dynamic executables were compiled with
-fPIEand linked with-pie. - If available, the
-fcf-protection=fulloption was used. - If available, the
-mbranch-protectionoption was used. - If available, the
-mstackrealignoption was used.
Disable the hardening checker Copy linkLink copied!
Copy linkLink copied!
To skip security checks during binary analysis, disable the hardening checker by using the annocheck utility.
Procedure Copy linkLink copied!
Copy linkLink copied!
To scan the notes in a file without the hardening checker, use:
$ annocheck --enable-notes --disable-hardened file-name
Replace file-name with the name of a file.