-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
BouncyCastleFipsJsse application hangs on systems which do not have enough entropy #26736
Comments
Interesting, also CC @cescoffier, I guess the only option is to tune |
I would need to check. The vertx stack generally indicates a problem when netty computes the machine id (most of the time because of dns). However if I remember directly there is a random object that may be used. If that's the case, one approach would be to pass a machine id, and avoid the computation. |
My bad, it's not the machine id in this case. It's when loading the key store, it requires a random generator that blocks because of the lack of entropy. @sberyozkin can we try to switch to SHA1PRNG? |
Hi @cescoffier I think if it were to be done then it could only be done on the test case level only, however, this would probably make the test not really working in a FIPS mode as I still think though the problem should be addressed at the Vert.x HTTP level - something has gone wrong at the low level while doing |
I agree, but here is the thing: if you do not have enough entropy, you will be stuck forever (until the entropy reaches a certain level). |
This one must've been fixed by #40665, @fedinskiy, please reopen if you will get a chance to double check and confirm it is still an issue |
Describe the bug
I have an application with BouncyCastleFipsJsse endpoint. When I start the application on a freshly created virtual machine, it hangs on start up with messages "Thread blocked". After looking into code from stacktraces, I found, that the code blocks, while reading from
/dev/random
which does not have enough entropy yet(cat /proc/sys/kernel/random/entropy_avail
returns 35). This problem does not affect BouncyCastleFips without JSSE.Expected behavior
The application should not hang on any system.
Actual behavior
The application hangs and puts these stacktraces into cli:
and
How to Reproduce?
cat /proc/sys/kernel/random/entropy_avail
should return a small value, I reproduced this robustly, with results between 35 to 851.git clone -b 2.7 [email protected]:quarkus-qe/quarkus-test-suite.git tests
cd tests/security/bouncycastle-fips/bcFipsJsse
jobs -l
andkill
For debugging, do this instead of step 4:
mvn clean package -DskipTests -DskipITs
java -Djava.security.debug=provider -jar target/quarkus-app/quarkus-run.jar > debug.txt 2>&1
and Ctrl+C after several seconds.grep "NativePRNG" debug.txt
Output of
uname -a
orver
4.18.0-372.9.1.el8.x86_64
Output of
java -version
11.0.13, vendor: Red Hat, Inc.
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.7.6.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
No response
The text was updated successfully, but these errors were encountered: