Bug 2039353 - [35 Regression] CET isn't enabled in zstd-1.5.1-4.fc35.x86_64
Summary: [35 Regression] CET isn't enabled in zstd-1.5.1-4.fc35.x86_64
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: zstd
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pádraig Brady
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2036740 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-11 15:04 UTC by H.J. Lu
Modified: 2022-01-20 13:32 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-01-20 13:32:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github facebook zstd pull 2992 0 None open x86-64: Enable Intel CET 2022-01-11 16:24:18 UTC
Github facebook zstd pull 2993 0 None open x86-64: Hide internal assembly functions 2022-01-11 16:24:18 UTC

Description H.J. Lu 2022-01-11 15:04:58 UTC
[hjl@gnu-tgl-3 binutils]$ readelf -n  /lib64/libzstd.so.1.5.1 | head -10
readelf: Warning: Gap in build notes detected from 0x93be1 to 0x93bff
readelf: Warning: Gap in build notes detected from 0xa44a8 to 0xa44bf

Displaying notes found in: .note.gnu.property
  Owner                Data size 	Description
  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
      Properties: x86 feature used: x86, XMM
	x86 ISA used: x86-64-baseline, x86-64-v3

Displaying notes found in: .note.gnu.build-id
  Owner                Data size 	Description
  GNU                  0x00000014	NT_GNU_BUILD_ID (unique build ID bitstring)
[hjl@gnu-tgl-3 binutils]$ rpm -qfi /lib64/libzstd.so.1.5.1
Name        : libzstd
Version     : 1.5.1
Release     : 4.fc35
Architecture: x86_64
Install Date: Tue 04 Jan 2022 07:28:01 PM PST
Group       : Unspecified
Size        : 898211
License     : BSD and GPLv2
Signature   : RSA/SHA256, Mon 03 Jan 2022 11:39:10 AM PST, Key ID db4639719867c58f
Source RPM  : zstd-1.5.1-4.fc35.src.rpm
Build Date  : Mon 03 Jan 2022 09:38:19 AM PST
Build Host  : buildvm-x86-18.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://github.com/facebook/zstd
Bug URL     : https://bugz.fedoraproject.org/zstd
Summary     : Zstd shared library
Description :
Zstandard compression shared library.
[hjl@gnu-tgl-3 binutils]$

Comment 1 H.J. Lu 2022-01-11 15:14:59 UTC
lib/decompress/huf_decompress_amd64.S isn't CET enabled.

Comment 2 H.J. Lu 2022-01-11 16:31:37 UTC
*** Bug 2036740 has been marked as a duplicate of this bug. ***

Comment 3 Carlos O'Donell 2022-01-11 17:43:24 UTC
Build is here: https://koji.fedoraproject.org/koji/buildinfo?buildID=1872345

annocheck says it has passed:

annocheck -v libzstd-1.5.1-4.fc35.x86_64.rpm 
annocheck: Version 9.79.
...
Hardened: ./usr/lib64/libzstd.so.1.5.1: PASS: property-note test 
...
Hardened: ./usr/lib64/libzstd.so.1.5.1: PASS: cf-protection test 
...

This check is what we use to detect regressions in the releases.

However, the note is missing SHSTK and IBT:

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000020       NT_GNU_PROPERTY_TYPE_0        Properties: x86 feature used: x86, XMM, x86 ISA used: x86-64-baseline, x86-64-v3

In libzstd-1.5.0-1.fc34.x86_64:

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0        Properties: x86 feature: IBT, SHSTK

This looks like an annocheck failure.

Asking Nick Clifton for feedback.

Nick, What do you think?

Comment 4 Nick Clifton 2022-01-11 18:05:52 UTC
Hmm, using a newer annocheck produces a slightly better result:

  % annocheck libzstd-1.5.1-4.fc35.x86_64.rpm --debug-rpm libzstd-debuginfo-1.5.1-4.fc35.x86_64.rpm
  annocheck: Version 10.45.
  Hardened: libzstd.so.1.5.1: FAIL: cf-protection test because .note.gnu.property section did not contain the necessary flags 
  Hardened: Rerun annocheck with --verbose to see more information on the tests.
  Hardened: libzstd.so.1.5.1: Overall: FAIL.


But, the property note test is still PASSing.  This is obviously a bug in annocheck.  I will fix it tomorrow...

Comment 5 Nick Clifton 2022-01-11 18:14:45 UTC
Addendum.  I have found out why the property note test is passing.  You can have binaries that are built from combined GO and C sources.  GO does not support CET, so annocheck does not complain if it finds a property note, but the note does not indicate that CET is enabled.  (The detection of GO compiled binaries relies upon finding a .note.go.build note section which may occur after the .gnu_build_attributes section).  A bit flaky I feel.  I will work on improving it.

Comment 6 Pádraig Brady 2022-01-11 18:32:14 UTC
Rebuilding for f34, f35, f36


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