Bug 1841260

Summary: NetworkManager dispatcher script replaces resolv.conf in non-atomic fashion
Product: OpenShift Container Platform Reporter: Ben Nemec <bnemec>
Component: Machine Config OperatorAssignee: Ben Nemec <bnemec>
Status: CLOSED ERRATA QA Contact: Victor Voronkov <vvoronko>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5   
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:42:41 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 Ben Nemec 2020-05-28 17:53:50 UTC
Description of problem: During investigation of https://bugzilla.redhat.com/show_bug.cgi?id=1840222 it was noted that the way we were prepending our DNS server to resolv.conf is not atomic. This means that if sed were interrupted for any reason, it might leave an empty resolv.conf on disk. We should instead write the sed output to a temp file and then move it into place, which should be atomic and not prone to races.


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


How reproducible: Unsure, not easily.


Steps to Reproduce:
Wait for NetworkManager dispatcher script to start running, then kill the sed before it completes (perhaps by hard rebooting the system).

Actual results: /etc/resolv.conf will be empty because it was truncated by the redirection


Expected results: /etc/resolv.conf is left in its original state


Additional info: This is rather unlikely to happen, but since https://bugzilla.redhat.com/show_bug.cgi?id=1840222 appears to be a race bug we want to eliminate any possible races.

Comment 4 errata-xmlrpc 2020-07-13 17:42:41 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, 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/RHBA-2020:2409