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

include: ssp: ignore fortify for purecap #2260

Merged
merged 1 commit into from
Dec 10, 2024
Merged

include: ssp: ignore fortify for purecap #2260

merged 1 commit into from
Dec 10, 2024

Conversation

kwitaszczyk
Copy link
Member

@kwitaszczyk kwitaszczyk commented Dec 4, 2024

lib/libc/secure and hence *_chk() libc function variants for SSP are not built when the world is compiled for the pure-capability ABI.

In such a case, don't define __SSP_FORTIFY_LEVEL, based on _FORTIFY_SOURCE, that is used to redefine libc functions to their *_chk() variants. This check matches the check in lib/libc/Makefile to exclude lib/libc/secure.

With this change, devel/m4 that uses _FORTIFY_SOURCE builds correctly.

lib/libc/secure and hence *_chk() libc function variants for SSP are not
built when the world is compiled for the pure-capability ABI.

In such a case, don't define __SSP_FORTIFY_LEVEL, based on
_FORTIFY_SOURCE, that is used to redefine libc functions to their
*_chk() variants. This check matches the check in lib/libc/Makefile to
exclude lib/libc/secure.
@kwitaszczyk kwitaszczyk self-assigned this Dec 4, 2024
@bsdjhb
Copy link
Collaborator

bsdjhb commented Dec 4, 2024

I guess the question is if we think that purecap fully supplants the checks for fortify source, or if it only supplants some of them. If only some of them we should instead perhaps build the various *_chk routines but #ifdef out the checks that purecap already handles?

@brooksdavis
Copy link
Member

I think that longer term we should implement _FORTIFY_SOURCE eliding checks we're confident purecap provides and keeping ones it doesn't (e.g., checking for overlapping memcpy arguments). Thinking aloud, there might be some cases were purecap provides a different, but mostly sufficient check due to representability. We might want an option to keep strict check or elide them.

@bsdjhb
Copy link
Collaborator

bsdjhb commented Dec 10, 2024

I'm fine with merging this change for now, but we should open an issue to do what @brooksdavis described.

@bsdjhb bsdjhb merged commit ec8cff0 into dev Dec 10, 2024
30 checks passed
@bsdjhb bsdjhb deleted the fortify_source branch December 10, 2024 18:21
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