Skip to content

JVM Crash in cfb_decrypt with Java Corretto 21 #2253

@alexwatson

Description

@alexwatson

Repeatable JVM crash using Java corretto 21.0.9.11.1 when decrypting a PGP file with Bouncy Castle LTS v2.73.5 (and also v2.73.10).
JVM crash occurs on AWS server using Elastic Beanstalk Tomcat 11 / Corretto 21 running on 64 bit Amazon Linux 2023/5.9.3.
The same code works perfectly on MacBook Pro with Java corretto 21.0.8.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000ffffa012adc8, pid=64494, tid=65024
#
# JRE version: OpenJDK Runtime Environment Corretto-21.0.9.11.1 (21.0.9+11) (build 21.0.9+11-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-21.0.9.11.1 (21.0.9+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-aarch64)
# Problematic frame:
# C  [libbc-lts-neon-le.so+0xedc8]  cfb_decrypt+0x104
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /usr/share/tomcat11/core.64494)
#
# If you would like to submit a bug report, please visit:
#   https://github.com/corretto/corretto-21/issues/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Maven dependencies (with versions 2.73.5 and 2.73.10):

<dependency>
	<groupId>org.bouncycastle</groupId>
	<artifactId>bcprov-lts8on</artifactId>
	<version>${bouncy-castle-version}</version>
</dependency>
<dependency>
	<groupId>org.bouncycastle</groupId>
	<artifactId>bcpkix-lts8on</artifactId>
	<version>${bouncy-castle-version}</version>
</dependency>
<dependency>
	<groupId>org.bouncycastle</groupId>
	<artifactId>bcpg-lts8on</artifactId>
	<version>${bouncy-castle-version}</version>
</dependency>
Host: AArch64, 1 cores, 1G, Amazon Linux release 2023.10.20260120 (Amazon Linux)
Time: Wed Feb 11 12:49:36 2026 AEDT elapsed time: 2337.653122 seconds (0d 0h 38m 57s)

---------------  T H R E A D  ---------------

Current thread (0x0000ffff9f5beb00):  JavaThread "au.com.vikingc.webmonitortools.jobs.JobManagerExecutorThread" daemon [_thread_in_native, id=65024, stack(0x0000ffff65c0e000,0x0000ffff65e0c000) (2040K)]

Stack: [0x0000ffff65c0e000,0x0000ffff65e0c000],  sp=0x0000ffff65e09520,  free space=2029k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libbc-lts-neon-le.so+0xedc8]  cfb_decrypt+0x104
C  [libbc-lts-neon-le.so+0xf1c8]  Java_org_bouncycastle_crypto_engines_AESNativeCFB_processBytes+0x198
j  org.bouncycastle.crypto.engines.AESNativeCFB.processBytes(J[BII[BI)I+0
j  org.bouncycastle.crypto.engines.AESNativeCFB.processBytes([BII[BI)I+31
j  org.bouncycastle.crypto.engines.AESNativeCFB.processBlocks([BII[BI)I+30
j  org.bouncycastle.crypto.DefaultBufferedBlockCipher.processBytes([BII[BI)I+209
j  org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.processBytes([BII[BI)I+11
j  org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal([BII)[B+26
j  javax.crypto.Cipher.doFinal([BII)[B+46 [email protected]
j  org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder$1.recoverKeyData(I[B[B[BII)[B+61
j  org.bouncycastle.openpgp.PGPSecretKey.extractKeyData(Lorg/bouncycastle/openpgp/operator/PBESecretKeyDecryptor;)[B+147
j  org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey(Lorg/bouncycastle/openpgp/operator/PBESecretKeyDecryptor;)Lorg/bouncycastle/openpgp/PGPPrivateKey;+19
j  au.com.vikingc.universalfilesystem.encryption.PGPEncryptionProvider.decrypt(Ljava/io/InputStream;)Ljava/io/InputStream;+193

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions