RFR: 8263743: redundant lock in SSLSocketImpl
Xue-Lei Andrew Fan
xuelei at openjdk.java.net
Wed Mar 17 17:28:01 UTC 2021
Remove redundant lock in SSLSocketImpl.
In the SSLSocketImpl, there is a socket level lock while reading application data (see readApplicationRecord).
socketLock.lock();
try {
plainText = decode(buffer);
} finally {
socketLock.unlock();
}
If an application data read is in progress, other calling to SSLSocket APIs (for example getUseClientMode()) could be blocked if socket level locks are used.
No new regression test. Simple fix, hard to trigger the deadlock.
-------------
Commit messages:
- 8263743: redundant lock in SSLSocketImpl
Changes: https://git.openjdk.java.net/jdk/pull/3053/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3053&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8263743
Stats: 7 lines in 1 file changed: 0 ins; 6 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/3053.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3053/head:pull/3053
PR: https://git.openjdk.java.net/jdk/pull/3053
More information about the security-dev
mailing list