Re: Extend default compiler settings to harden applications

Christoph Erhardt <[email protected]>
Newsgroups gmane.linux.redhat.fedora.devel
Message-ID <[email protected]>
Hi Norbert,

this sounds a sensible initiative to me.

Do you have more information to share? Areas of interest:
* concrete numbers from the performance measurements,
* number and names of packages that required fixing,
* their upstream status.

In principle I see two possible ways for introducing the new flags:
a) Append them to `_hardening_cflags` if we consider them generic hardening 
options that should be set for every hardened build.
b) Allow more fine-grained control by introducing an extra macro, similar to 
e.g. `_include_frame_pointers`.

I'm not sure which is preferable here.

Regarding `-ftrivial-auto-var-init=zero`: this is best done as a separate 
effort because its implications are somewhat more invasive from what I know.

Thanks,
Christoph

On Friday, 14 August 2026 09:43:44 Central European Summer Time Manthey, 
Norbert via devel wrote:
> Hi all,
> 
> I would like to propose hardening Fedora artifacts by extending the default
> compilation flags. In the past, using the flags would have prevented or
> revealed CVEs or logic bugs.
> 
> In Amazon Linux we have been looking into changing the default compiler
> flags. Specifically, we looked at adding the below:
> 
>   -fno-strict-overflow
>   -fno-strict-aliasing
>   -fno-delete-null-pointer-checks
> 
> For these flags, we did not see significant changes in performance tests. We
> found a few packages where the additional flags caused build errors, and
> submitted fixed to the respective packages.
> 
> What's a good process to get the flags into the redhat-rpm-config package,
> e.g. via a new macro that could be overriden by specific spec files in case
> the flags should not be used? Is there more information I should provide?
> Would there be another process for other flags, like
> -ftrivial-auto-var-init=zero where there can be minor performance
> consequences?
> 
> Best,
> Norbert

-- 
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: https://forge.fedoraproject.org/infra/tickets/issues/new
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEwp5/nkNlccrQ2UKH4yzDBS9Gs8IFAmqByQUACgkQ4yzDBS9G
s8LZ4g/+NRQ7CBxcWHLSZH4qmYbTQ91xpOm9oF6bMPnw27EDAiqgrQcAWwdzAY1q
UU1QpdambMJ8XsLwjmQtQav6Lpin/TJk+ddt/aek7Hkp629kA35YLrStWjhenvao
/dzfEJpxIqmDe3udLY6TmWzxzi5VKpqu2pPisvxxqYDq6WEuFjSono/XgZ+sDR3I
X3DPuVj8S3vLFS0aFPy+QbNgeUOR1ip/4eCOEH34+ZISpmSzGm3cWOO9tax4QGkV
CUA+dCOGErypwmIVgWf52pXSzEYRvCZlhtTqchYC82UbhNCA95tId75a9nXdcycj
72vifLCUrK7pSFFBTt1CHoO3MoDBmqsCm4ys/zRMKF4ZCh+bV5t8kQvGyWc5BRHG
Y/HGgkosD111sbQxQa2WOKIWRQIdSSsun9Y8qPVz4m58Gw6trw4h+MPhWUtV4jBm
A0iEh9Co563Ftvfa2a/u2kghDSA5PZT6jgQWOp4WaHYkXcehcGAWd1bSOVOzAtxY
dVF3z7UGIlqkS2KXYWT04stGU9ud8LSZN4mHYaoHUKy0d5Ieh9fa1kQz8NZS7PyJ
vqBXpcUhDh7IW+OBiRG5qryfEB30noG7aCEBIa7ss83ATEWtSJOsAzXhFBWvT0GM
oHoAI4Im66Jh12w831I5x84RsgAdWsw4GHohAV9ZrlWPrWYAOpA=
=jHBi
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.