Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compiler defenses flags - additional updates #162

Closed
wants to merge 4 commits into from

Conversation

tasleson
Copy link
Contributor

PR: #145 with some additional fixes.

pawpiatko and others added 4 commits August 24, 2023 15:59
It is essential to avoid buffer overflows and similar bugs as much as
possible.

Add AX_CHECK_LINK_FLAG macro usage witch requires `autoconf-archive`
package to be installed.

Add compiler flags:
-D_FORTIFY_SOURCE - Compile-time protection against static sized
buffer overflows,
-fstack-protector-strong - Adds stack canaries to functions as
safety checks against stack overwrites,
-fPIE - Enables an ELF binary executable to be position independent,
-fPIC - Ensures that shared object code that is built into shared
libraries should be position independent code, so that the shared
library can readily be loaded at any address in memory.

Add linker flags:
-pie - works together with gcc flag fPIE- please see its description,
-z,relro - A security measure which makes some binary sections
read-only,
-z,now - Immediate Binding (Bindnow),
-z,noexecstack - Prevents stack from being executable.

Add 'autoconf-archive' package dependency to github workflows.
This change is requied by githab actions.

Fix compilation warnings.

Signed-off-by: Pawel Piatkowski <pawel.piatkowski@intel.com>
This should be: -fno-delete-null-pointer-checks not
-Wno-delete-null-pointer-checks.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
device_blink_behavior_set should not be public.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Corrects warning from [-Wenum-int-mismatch] for const unsigned int
mismatch with const enum led_ibpi_pattern.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
@tasleson tasleson changed the title Compiler defenses Add compiler defenses flags - additional updates Aug 24, 2023
@mtkaczyk
Copy link
Contributor

I need to double verify how we should handle those flags. I'm not sure I they should be here. I need more time to check. Will do next week.

@tasleson
Copy link
Contributor Author

Closing, will add a new PR after other PRs get merged if parts of this PR are still missing.

@tasleson tasleson closed this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants