Bug 1841260 - NetworkManager dispatcher script replaces resolv.conf in non-atomic fashion
Summary: NetworkManager dispatcher script replaces resolv.conf in non-atomic fashion
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Machine Config Operator
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.5.0
Assignee: Ben Nemec
QA Contact: Victor Voronkov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-28 17:53 UTC by Ben Nemec
Modified: 2020-07-13 17:42 UTC (History)
0 users

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:42:41 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 1763 0 None closed Bug 1841260: Make resolv.conf prepend operation atomic 2020-08-19 12:04:18 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:42:55 UTC

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


Note You need to log in before you can comment on or make changes to this bug.