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 1002312

Summary: IKEv2 skeyseed calculation only succeeds because of unspecified compiler behaviour
Product: Red Hat Enterprise Linux 6 Reporter: Paul Wouters <pwouters>
Component: openswanAssignee: Paul Wouters <pwouters>
Status: CLOSED ERRATA QA Contact: Ondrej Moriš <omoris>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: amarecek, eparis, omoris, pwouters, sgrubb
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 23:47:45 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:
Attachments:
Description Flags
patch to fix re-using uninitialised variable none

Description Paul Wouters 2013-08-28 21:17:36 UTC
After exchanging nonces in IKEv2 for creating a shared secret, the function calc_skeyseed_v2() is called. It uses a variable PK11SymKey *tkey11;
This variable is defined within a for loop, meaning each iteration gets a fresh new variable. However, the code actually does two passes and expects the content to survive. And for some lucky reason with our current compiler, it does. On the second iteration, it gets the same memory location back, and things work miraculously.

I asked what we should do. This has worked in every RHEL6 release (although it should not have). Steve Grubb suggested that I fix this for RHEL 6.5 because of certification.

When the code is fixed with the attached patch, an interop should be done to either a non-openswan system using IKEv2, or an older unpatched openswan system with IKEv2. I confirmed the code works by doing an interop with strongswan.

furthermore, you should see the gcc compiler warning about tkey11 for "could be used uninitialised" vanish from the build log.

Comment 1 Paul Wouters 2013-08-28 21:18:42 UTC
Created attachment 791536 [details]
patch to fix re-using uninitialised variable

Comment 6 Ondrej Moriš 2013-10-03 12:30:00 UTC
(In reply to Paul Wouters from comment #0)

> furthermore, you should see the gcc compiler warning about tkey11 for "could
> be used uninitialised" vanish from the build log.

It looks like gcc was never complained about this at least while rebuilding source rpm package. Therefore I am just checking that openswan<->strongswan connection with ikev2=insist option on openswan side and keyexchange=ikev2 on strongswan side works.

Comment 8 errata-xmlrpc 2013-11-21 23:47:45 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2013-1718.html