Bug 2293107 - Provide some default ASFLAGS
Summary: Provide some default ASFLAGS
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Florian Festi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-06-19 18:05 UTC by Vít Ondruch
Modified: 2024-07-02 11:35 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-02 11:35:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Vít Ondruch 2024-06-19 18:05:54 UTC
Looking into hardening of Ruby, there was recently merged this [1] PR. If I understand correctly, it includes this [2] header (leaving aside the OpenBSD condition), which needs to have `__CET__` macro defined. If I read the documentation [3] correctly, it is defined when the compiler is provide with `-fcf-protection` option. Ruby does not set the option on itself (as likely other flags we set by default) and I wonder, shouldn't this be rather configured system wide via ASFLAGS? I am afraid that including the header is likely not enough for proper hardening, but not try to include it is also wrong, isn't it?


[1]: https://github.com/ruby/ruby/pull/10987
[2]: https://github.com/gcc-mirror/gcc/blob/8088374a868aacab4dff208ec3e3fde790a1d9a3/gcc/config/i386/cet.h
[3]: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

Reproducible: Always

Comment 1 Vít Ondruch 2024-07-01 18:19:25 UTC
@fweimer actually, in the context of [1], isn't this a gap from the beginning? IOW if app/lib includes some assembler code, it is not hardened while it appears differently at the first look


[1]: https://fedoraproject.org/wiki/Changes/HardeningFlags28

Comment 2 Florian Weimer 2024-07-01 19:05:53 UTC
GNU make has a default rule that passes $(ASFLAGS) to $(AS), which is the as program, not the gcc compiler driver: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-assembly_002c-rule-to-compile

So ASFLAGS is really not the place to pass -fcfprotection. It's not an option that the as program can understand, and direct invocations of as won't use the preprocessor anyway.

This is something that needs to be solved on a per-package basis unfortunately.

Comment 3 Vít Ondruch 2024-07-02 11:35:26 UTC
Thx for the hint. Looking into Ruby history, there is certainly something fishy. I am closing this for a while and will pursue upstream change.


Note You need to log in before you can comment on or make changes to this bug.