| Summary: | hardening-check FTBFS if "-Werror=format-security" flag is used | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dhiru Kholia <dkholia> |
| Component: | hardening-check | Assignee: | Björn 'besser82' Esser <besser82> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | besser82, bressers, dhiru |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-05-24 14:35:11 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1038083 | ||
|
Description
Dhiru Kholia
2013-12-03 03:10:43 UTC
This is part of the testsuite from hardening-wrapper. ;)
Excerpt from build.log:
# Make sure build fails due to -Werror=format-security
! cc -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-format-security format.c
format.c: In function 'main':
format.c:11:5: error: format not a string literal and no format arguments [-Werror=format-security]
return fprintf(stderr, argv[0]);
^
cc1: some warnings being treated as errors
# Make sure build succeeds with -Wno-format-security
cc -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wno-format-security -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-format-security format.c
# Make sure build stack-protects a small ssp buffer
cc -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -O2 -Wl,-z,relro -Wl,-z,now -o ../build-tree/includes-test-ssp-buffer-size-protect ssp-buffer-size-protect.c
It is intentional to have a build-fail during compilation, because the testsuite is meant to give output which should be checked by a human to make sure everything is working as expected. One point of that human check is to see 'format.c' *MUST* fail with 'format not a string literal and no format arguments' when '-Werror=format-security' is used during compilation.
Closing this, since this is a false positive and NOT a bug. ;)
|