Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2133809

Summary: OPENSSL_strcasecmp versioning
Product: Red Hat Enterprise Linux 9 Reporter: Dmitry Belyavskiy <dbelyavs>
Component: opensslAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED ERRATA QA Contact: Alicja Kario <hkario>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: cllang, fweimer, hkario, ssorce
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssl-3.0.7-2.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:20:36 UTC Type: Bug
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: 2148469    
Bug Blocks:    

Description Dmitry Belyavskiy 2022-10-11 13:18:56 UTC
We backported OPENSSL_strcasecmp and OPENSSL_strncasecmp functions in our 3.0.1 version. Upstream has 3.0.3 version for both of these functions.

We need to provide both versions to allow 3rd-party applications to use both Red Hat and upstream versions of OpenSSL libraries without rebuild.

Comment 3 Florian Weimer 2022-11-21 19:04:50 UTC
Do you plan to rebase to OpenSSL 3.0.3, so that you get the full symbol set at this version? RPM dependency management only works at the symbol set level, so things go wrong if you backport only part of the set. (Perhaps you are lucky and it's just the pair, them there's no problem.)

I assume it's just an internal hack, so whatever works with our toolchain is acceptable. This appears to work

cat > t.c <<EOF
int __attribute__ ((symver ("OPENSSL_strcasecmp.1"),
                    symver ("OPENSSL_strcasecmp@@OPENSSL_3.0.3")))
OPENSSL_strcasecmp (const char *a, const char *b)
{
  return 0;
}
EOF
cat > t.lds <<EOF
OPENSSL_3.0.1 {
  global: OPENSSL_strcasecmp;
  local: *;
};
OPENSSL_3.0.3 {
  global: OPENSSL_strcasecmp;
  local: *;
} OPENSSL_3.0.1;
EOF
gcc -Wall -O2 -shared -fpic t.c -Wl,--version-script t.lds

@@ is the default version, @ is for compatibility with old binaries. It appears to work with gcc-11.3.1-2.1.el9.x86_64 and
binutils-2.35.2-24.el9.x86_64. It should be LTO-compatible, too. If there are issues, we can and should fix them on the toolchain side (symver had bugs before). Note that this is not suitable for upstream use because symver support in GCC and multi-.symver support in binutils are fairly recent.

If I remember the challenges from the OpenSSL 3 transitions correctly, your main issue will be integrating this approach into the OpenSSL build process and its idiosyncratic approach to symbol management. (The glibc build system has the same problem, although the details are of course very different.)

Comment 4 Dmitry Belyavskiy 2022-11-21 19:19:55 UTC
We plan to rebase to 3.0.7

Thank you very much!

Comment 8 Dmitry Belyavskiy 2022-11-25 17:46:49 UTC
To avoid the problems I met, I added -Wl,--allow-multiple-definition to compiler options. And, as FIPS module builds these functions itself, I wrapped the extra attributes with #ifndef FIPS_MODULE

Comment 16 errata-xmlrpc 2023-05-09 08:20:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: openssl security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2523