This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1135504 - java-1.8.0-openjdk: GHASH performance improvement
java-1.8.0-openjdk: GHASH performance improvement
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: java-1.8.0-openjdk (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: jiri vanek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-29 09:22 EDT by Florian Weimer
Modified: 2016-01-30 02:41 EST (History)
6 users (show)

See Also:
Fixed In Version: java-1.8.0-openjdk-1.8.0.60-14.b27.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-30 02:41:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
jdk.patch (12.52 KB, patch)
2014-08-29 09:22 EDT, Florian Weimer
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
openjdk bug system JDK-8069072 None None None Never

  None (edit)
Description Florian Weimer 2014-08-29 09:22:42 EDT
Created attachment 932685 [details]
jdk.patch

When OpenJDK 8 negotiates an AES-GCM cipher suite with a TLS peer, performance is extremely poor.  To a large degree, this is due to a very inefficient implementation of the GHASH primitive within the AES-GCM implementation.

The upstream review thread is here:

http://mail.openjdk.java.net/pipermail/security-dev/2014-August/011009.html

Upstream does not appear to be inclined to review this patch at all, despite the crippling performance impact (less than 30 Mbps even on rather high-end hardware).

The patch I posted (and which is attached to this bug) only removes some of the allocations in the AES-GCM implementations, so there is quite a bit of room for additional improvements.  Even after these changes, the TLS implementation will allocate four bytes for every byte transferred.  Changing this is not too difficult, but it is less self-contained than the GHASH performance fix and should definitely happen upstream first.

Hubert Kario kindly emulated the OpenJDK TLS handshake and used his most recent scan <https://securitypitfalls.wordpress.com/2014/08/03/july-2014-scan-results/> to estimate which fraction of the servers in the set negotiates an AES-GCM cipher suite with OpenJDK 8.  According to these numbers, around 40% support AES-GCM, and 20% will negotiate it with an OpenJDK peer.  This makes it fairly likely that programs will run into the performance issue.
Comment 5 jens.borgland 2015-01-20 03:53:29 EST
We've tried using AES-GCM cipher suites in our product but had to revert to CBC suites due to the extremely poor performance. I think this bug should have a very high priority.
Comment 7 Florian Weimer 2015-01-20 04:41:49 EST
Current upstream discussion (for JDK 9):

  <http://mail.openjdk.java.net/pipermail/security-dev/2015-January/011601.html>

Most recent webrev so far:

  <http://cr.openjdk.java.net/~fweimer/8069072/webrev.01/>
Comment 8 Florian Weimer 2015-02-10 04:36:57 EST
JDK 9 change was committed upstream: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/054e5baae476

I will wait a few days and propose the backport to JDK 8 after it has soaked a bit in 9.
Comment 9 Florian Weimer 2015-02-16 13:48:05 EST
Backport has been committed upstream, for 8u60:

http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/5923854f14f7
Comment 10 Jaroslav Reznik 2015-03-03 11:15:25 EST
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
Comment 11 Andrew John Hughes 2016-01-30 02:41:30 EST
This was fixed in u60:

https://bugs.openjdk.java.net/browse/JDK-8069072

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