Bug 2359082

Summary: SIGILL from libcrypto.so.3.5.0
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: opensslAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: crypto-team, dbelyavs, mspacek, mturk, praiskup, shebburn, suraj.ghimire7, tm
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: openssl-3.5.0-3.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-16 17:24:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

Description Dan Horák 2025-04-11 12:37:01 UTC
dnf crashes due a SIGILL from libcrypto on our Power8 system. I guess some algorithm is built for a later generation of Power CPU/ISA.

Apr 11 12:33:13 tyan-openpower-01.lab.eng.brq2.redhat.com systemd-coredump[1797459]: Process 1797453 (dnf) of user 0 terminated abnormally with signal 4/ILL, processing...
Apr 11 12:33:13 tyan-openpower-01.lab.eng.brq2.redhat.com kernel: dnf[1797453]: illegal instruction (4) at 7fff9ee95424 nip 7fff9ee95424 lr 7fff9ee9633c code 1 in libcrypto.so.3.5.0[3b5424,>
Apr 11 12:33:13 tyan-openpower-01.lab.eng.brq2.redhat.com kernel: dnf[1797453]: code: e8e40008 e9040010 e9240018 e9440020 e9640028 e9840030 100004c4 7dc631d2 
Apr 11 12:33:13 tyan-openpower-01.lab.eng.brq2.redhat.com kernel: dnf[1797453]: code: 7de63012 f9c30000 f9e30008 7dc63214 <7da07367> 7dc03b67 102d7023 7de77367 


openssl-3.5.0-2.fc43.ppc64le

Reproducible: Always

Comment 1 Dmitry Belyavskiy 2025-04-11 12:41:08 UTC
Could you please report this issue upstream? Our downstream patches don't touch assembler code

Comment 2 Dan Horák 2025-04-11 12:43:05 UTC
ack, will do

Comment 3 Dmitry Belyavskiy 2025-04-15 13:49:55 UTC
*** Bug 2359744 has been marked as a duplicate of this bug. ***

Comment 4 Dmitry Belyavskiy 2025-04-15 15:02:23 UTC
Could you please try this build if the infrastructure wakes up
https://koji.fedoraproject.org/koji/taskinfo?taskID=131563912

Comment 5 Dan Horák 2025-04-15 18:10:25 UTC
no more a SIGILL as far as I can tell, what change did you made?

Comment 6 Dmitry Belyavskiy 2025-04-15 18:16:58 UTC
A build without this flag "enable-ec_nistp_64_gcc_128", as proposed in https://github.com/openssl/openssl/issues/27350

If you have anyone who knows ppc64le asm, it would be great to implement a proper fix - otherwise it would stay vulnerable to side-channel attacks (fixing them introduced this issue)

Comment 7 Fedora Update System 2025-04-16 10:13:49 UTC
FEDORA-2025-c31309a82b (openssl-3.5.0-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-c31309a82b

Comment 8 Dan Horák 2025-04-16 10:26:43 UTC
(In reply to Dmitry Belyavskiy from comment #6)
> A build without this flag "enable-ec_nistp_64_gcc_128", as proposed in
> https://github.com/openssl/openssl/issues/27350

for the record, we need this change only in Fedora, RHEL 9+ requires Power9 or newer, so it's safe with the new implementation
 
> If you have anyone who knows ppc64le asm, it would be great to implement a
> proper fix - otherwise it would stay vulnerable to side-channel attacks
> (fixing them introduced this issue)

I will ask in the community, but it will be tough as it needs both Power ISA and security expertise ...

And as I am not familiar with OpenSSL code, do you think it's possible to change OpenSSL in a way that the new safe implementation would be selected during runtime when Power9+ CPU is detected and and the unsafe one for Power8 (it's EOL hw anyway)? I believe OpenSSL is generally capable of such runtime selection.

Comment 9 Dmitry Belyavskiy 2025-04-16 10:32:07 UTC
Probably this check should be made more strict:
        if (OPENSSL_ppccap_P & PPC_MADD300)

see man openssl-env for slightly more details

Comment 10 Fedora Update System 2025-04-16 17:24:58 UTC
FEDORA-2025-c31309a82b (openssl-3.5.0-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.