Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw if JDK-8292158 may cause AES-CTR encryption corruption #636

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

schlosna
Copy link
Contributor

@schlosna schlosna commented Dec 1, 2022

Before this PR

JDK bug https://bugs.openjdk.org/browse/JDK-8292158 could cause corruption of AES-CTR streams when running on CPUs with AVX-512 vectorized AES support (e.g. Intel Ice Lake, as used in AWS 6th generation EC2 instances).

This issue should be resolved in OpenJDK 11.0.18, 15.0.10, 17.0.6, 19.0.2, and 20.0.0 when released.

One can temporarily workaround this issue be adding one of the following sets of JVM arguments:

  • -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics to disable only AES-CTR intrinsics
  • -XX:+UnlockDiagnosticVMOptions -XX:-UseAESIntrinsics to disable all AES intrinsics
  • -XX:-UseAES to disable all AES native instructions
  • -XX:UseAVX=2 to disable all AVX-512 instructions

See palantir/sls-packaging#1411

After this PR

==COMMIT_MSG==
To avoid potential stream corruption, throw if JDK-8292158 may cause AES-CTR encryption corruption.

Determine if JVM is impacted by JDK-8292158 which can corrupt AES-CTR encryption streams. This bug impacts JDKs up to 11.0.18, 15.0.10, 17.0.6, 19.0.2 and when running on CPUs with AVX-512 vectorized AES support.

See https://bugs.openjdk.org/browse/JDK-8292158 introduced by https://bugs.openjdk.org/browse/JDK-8233741
==COMMIT_MSG==

Possible downsides?

This will fail fast and trigger runtime failures when running on un-mitigated JVMs rather than possible data corruption.

Determine if JVM is impacted by JDK-8292158 which can corrupt AES-CTR
encryption streams. This bug impacts JDKs up to 11.0.18, 15.0.10,
17.0.6, 19.0.2 and when running on CPUs with AVX-512 vectorized AES
support.

See https://bugs.openjdk.org/browse/JDK-8292158
@changelog-app
Copy link

changelog-app bot commented Dec 1, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

To avoid potential stream corruption, throw if JDK-8292158 may cause AES-CTR encryption corruption.

Determine if JVM is impacted by JDK-8292158 which can corrupt AES-CTR encryption streams. This bug impacts JDKs up to 11.0.18, 15.0.10, 17.0.6, 19.0.2 and when running on CPUs with AVX-512 vectorized AES support.

See https://bugs.openjdk.org/browse/JDK-8292158 introduced by https://bugs.openjdk.org/browse/JDK-8233741

Check the box to generate changelog(s)

  • Generate changelog entry

@schlosna schlosna marked this pull request as ready for review December 1, 2022 23:43
@carterkozak
Copy link
Contributor

Could we run the failing test case instead of attempting to determine whether or not the jvm+hardware combination is impacted?

@carterkozak
Copy link
Contributor

CI tests will be difficult/impossible, but a manual verification should be sufficient.

Determine if JVM is impacted by JDK-8292158 which can corrupt AES-CTR
encryption streams. This bug impacts JDKs up to 11.0.18, 15.0.10,
17.0.6, 19.0.2 and when running on CPUs with AVX-512 vectorized AES
support.

See https://bugs.openjdk.org/browse/JDK-8292158
@schlosna
Copy link
Contributor Author

schlosna commented Dec 2, 2022

Manually tested this on Intel Ice Lake and it identifies and catches the corruption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants