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

fixes AES decryption threading issue #5384

Merged
merged 1 commit into from
Mar 7, 2025
Merged

Conversation

keith-turner
Copy link
Contributor

A single Cipher object was shared between multiple inputstreams when decrypting AES data. This caused decryption to fail when mutliple threads created input streams for decryption. This could potentially cause failure for a single thread also if it interleaves reading from multiple streams that use the same Cipher.

Modified the code to create a Cipher per input stream.

A single Cipher object was shared between multiple inputstreams when
decrypting AES data. This caused decryption to fail when mutliple
threads created input streams for decryption.  This could potentially
cause failure for a single thread also if it interleaves reading from
multiple streams that use the same Cipher.

Modified the code to create a Cipher per input stream.
@keith-turner keith-turner added this to the 2.1.4 milestone Mar 7, 2025
Copy link
Contributor

@cshannon cshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, while reviewing this I noticed the encrypter is also storing those the cipher as a private member variable here and here.

I haven't taken a closer look but can the encrypter also be shared between multiple threads? If so then I think the same fix is needed there.

@keith-turner
Copy link
Contributor Author

LGTM, while reviewing this I noticed the encrypter is also storing those the cipher as a private member variable here and here.

I haven't taken a closer look but can the encrypter also be shared between multiple threads? If so then I think the same fix is needed there.

I do not think compactions would ever have multiple threads writing. WAL writes may have multiple threads writing, not sure need to investigate. I tried to create multithreaded unit test for the write case and was having problems getting that test working so did not change the write code. Will open a follow on issue.

@keith-turner keith-turner merged commit 9037d61 into apache:2.1 Mar 7, 2025
8 checks passed
@keith-turner keith-turner deleted the fix-aes branch March 7, 2025 14:49
@ctubbsii ctubbsii requested a review from PircDef March 7, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants