Bug 1862478 - annobin: aarch64 PAC+BTI need specific policy and checking.
Summary: annobin: aarch64 PAC+BTI need specific policy and checking.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: annobin
Version: 33
Hardware: aarch64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1862288
TreeView+ depends on / blocked
 
Reported: 2020-07-31 14:04 UTC by Carlos O'Donell
Modified: 2021-11-30 17:42 UTC (History)
3 users (show)

Fixed In Version: annobin-9.32-1.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-30 17:42:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Carlos O'Donell 2020-07-31 14:04:07 UTC
The recent enablement of aarch64 PAC+BTI means that we need to:

- Define policy for Fedora from the annobin side.
- Decide on exactly what we need to check to validate that policy.

This should be coordinated with Szabolcs Nagy <szabolcs.nagy> from Arm.

Comment 1 Nick Clifton 2020-07-31 14:35:34 UTC
FYI - the annobin gcc plugin stores the setting of the -mbranch-protection= option, and annocheck examines this setting and generates a FAIL result if it was set to -mbranch-protection=none.  At the moment it accepts any other setting as a PASS, but this could be changed.

Also this option is not currently tracked for Clang/LLVM.  To be honest I do not know if Clang//LVVM even support the option.

Comment 2 Florian Weimer 2020-07-31 14:43:36 UTC
Tracking -mbranch-protection= is not sufficient. It is useful for diagnostics and static libraries. It is also necessary to check that the final link has the required markup, so that glibc or the kernel activates the functionality.

Comment 3 Ben Cotton 2020-08-11 15:25:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 4 Nick Clifton 2020-09-16 07:39:13 UTC
Hi Guys,

  I have checked in an update to rawhide's annobin (annobin-9.32-1.fc34) which adds some tests for PAC and BTI.

  Currently the code checks to see that a .gnu_property note section exists, containing a single NT_GNU_PROPERTY_TYPE_0 note with at least one GNU_PROPERTY_AARCH64_FEATURE_1_AND field with the GNU_PROPERTY_AARCH64_FEATURE_1_BTI and GNU_PROPERTY_AARCH64_FEATURE_1_PAC bits set.

  If dynamic tags are present, then the code also checks that the DT_AARCH64_BTI_PLT and DT_AARCH64_PAC_PLT tags are included.  (I am not 100% sure that this is a requirement however...)

  Both of these tests are treated as "future features", so they do not generate FAIL results if the test does not pass.  Instead they generate an informative message indicating that the test will fail in the future.  For example:

  % annocheck /usr/lib/gcc/aarch64-redhat-linux/10/plugin/annobin.so.0.0.0
  annocheck: Version 9.32.
  Hardened: annobin.so.0.0.0: PASS: Both the BTI and PAC properties are present in the GNU Property note.
  Hardened: annobin.so.0.0.0: check: The BTI and PAC dynamic tags are missing.
  Hardened: annobin.so.0.0.0: note:  This test is not yet enabled, but if it was enabled, it would fail...

  Does this match your expectations ?

Cheers
  Nick

Comment 5 Carlos O'Donell 2021-01-14 20:52:04 UTC
(In reply to Nick Clifton from comment #4)
>   Currently the code checks to see that a .gnu_property note section exists,
> containing a single NT_GNU_PROPERTY_TYPE_0 note with at least one
> GNU_PROPERTY_AARCH64_FEATURE_1_AND field with the
> GNU_PROPERTY_AARCH64_FEATURE_1_BTI and GNU_PROPERTY_AARCH64_FEATURE_1_PAC
> bits set.
> 
>   If dynamic tags are present, then the code also checks that the
> DT_AARCH64_BTI_PLT and DT_AARCH64_PAC_PLT tags are included.  (I am not 100%
> sure that this is a requirement however...)
> 
>   Both of these tests are treated as "future features", so they do not
> generate FAIL results if the test does not pass.  Instead they generate an
> informative message indicating that the test will fail in the future.  For
> example:
> 
>   % annocheck /usr/lib/gcc/aarch64-redhat-linux/10/plugin/annobin.so.0.0.0
>   annocheck: Version 9.32.
>   Hardened: annobin.so.0.0.0: PASS: Both the BTI and PAC properties are
> present in the GNU Property note.
>   Hardened: annobin.so.0.0.0: check: The BTI and PAC dynamic tags are
> missing.
>   Hardened: annobin.so.0.0.0: note:  This test is not yet enabled, but if it
> was enabled, it would fail...
> 
>   Does this match your expectations ?

That sounds reasonable to me.

Comment 6 Ben Cotton 2021-11-04 16:19:02 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2021-11-30 17:42:15 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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