Bug 2159458

Summary: Do not restart close if errno is EINTR [rhel-7.9.z]
Product: Red Hat Enterprise Linux 7 Reporter: Andrew Mike <amike>
Component: java-1.8.0-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: OpenJDK QA <java-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.9CC: alanm, brclark, casantos, jandrlik, jvanek, jwright, kpfleming, mkielian, mkolbas, pandrade, sfroberg
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: java-1.8.0-openjdk-1.8.0.372.b07-1.el7_9 Doc Type: Release Note
Doc Text:
Native code within the OpenJDK code base attempted to call close() on a file descriptor repeatedly if it returned the error code, EINTR. However, the close() native call is not restartable and this caused the virtual machine to crash. The close() call is now only made once.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-25 02:49:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Mike 2023-01-09 16:44:48 UTC
Description of problem (from upstream bug):

In java.base/linux/native/libnet/linux_close.c:

        do {
            if (fd1 < 0) {
                rv = close(fd2);
            } else {
                rv = dup2(fd1, fd2);
            }
        } while (rv == -1 && errno == EINTR);

However, the close() call is not restartable.
Only dup2() needs to be restarted if interrupted. 


Version-Release number of selected component (if applicable):
All versions

Additional info:
- This is a request from one of our customers to backport the patch for https://bugs.openjdk.org/browse/JDK-8205959 to OpenJDK 8. This was identified as the cause of one of their applications crashing by an external vendor.

Comment 3 Andrew John Hughes 2023-02-09 17:38:11 UTC
Pull request opened upstream: https://github.com/openjdk/jdk8u-dev/pull/267

Comment 4 Andrew John Hughes 2023-02-15 03:39:07 UTC
Included as part of jdk8u372-b03 so will be in the April release: https://bugs.openjdk.org/browse/JDK-8302271

Comment 13 errata-xmlrpc 2023-04-25 02:49:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: java-1.8.0-openjdk security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:1904