Bug 2218031

Summary: Double close in libdebuginfod
Product: Red Hat Enterprise Linux 9 Reporter: Mark Wielaard <mjw>
Component: elfutilsAssignee: Mark Wielaard <mjw>
elfutils sub component: system-version QA Contact: Martin Cermak <mcermak>
Status: VERIFIED --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: mcermak, mjw, wcohen
Version: 9.3Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: elfutils-0.189-3.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2218034 (view as bug list) Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 2218034    

Description Mark Wielaard 2023-06-27 22:07:28 UTC
In multithreaded programs there is a small race window where a file descriptor is closed twice. If in that small window in another thread a new file descriptor is created with the same fd handle/number it will get immediately closed causing wierd bugs.

The fix is simple, don't close the file descriptor twice.

See https://sourceware.org/cgit/elfutils/commit/?id=938a52c22ee915ff2cea813edd5da66bc8184885