EnricoMi opened a new pull request, #44990:
URL: https://github.com/apache/arrow/pull/44990

   ### Rationale for this change
   
   OpenSSL encryption / decryption is wrapped by AesEncryptor / AesDencryptor, 
which is used by multiple threads of a single scanner or by multiple concurrent 
scanners when scanning a dataset. Some thread may call `WipeOut` while other 
threads still use the instance.
   
   ### What changes are included in this PR?
   
   - Remove the `WipeOut` methods and related datastructures entirely.
   - Each call into `CtrEncrypt` / `CtrDecrypt` and `GcmEncrypt` / `GcmDecrypt` 
uses its own `EVP_CIPHER_CTX` instance, making this thread-safe.
   - To reduce initialization time of the `EVP_CIPHER_CTX` instance, a copy of 
an initalized but unused context is used.
   
   After fixing this `"AesDecryptor was wiped out"` issue, two other 
segmentation faults surfaced: GH-44988. This has also been addressed here as it 
can only be exposed after fixing the wipe-out issue.
   
   Fixes GH-43057.
   Fixes GH-44852.
   Fixes GH-44988.
   
   ### Are these changes tested?
   A unit test that scans a dataset concurrently reproduced the initial issue 
in 30% of the test runs.
   
   ### Are there any user-facing changes?
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to