Bug 680789
Summary: | logrotate: Race condition by creation of new files after renaming the previous version if compression or copy creation requested (arbitrary system file integrity corruption) | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] Security Response | Reporter: | Jan Lieskovsky <jlieskov> | ||||
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> | ||||
Status: | CLOSED NOTABUG | QA Contact: | |||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | unspecified | CC: | jkaluza, petr.uzel, tsmetana | ||||
Target Milestone: | --- | Keywords: | Security | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2011-03-11 06:30:25 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Jan Lieskovsky
2011-02-27 19:17:28 UTC
Created attachment 481568 [details]
proposed patch
This is backported patch from Debian without unlink command which fixes this issue.
Note that final patch can change, because this issue is tightly connected with other bugs, so there will be maybe one bigger patch which will cover more bugs. Further clarified details from Stefan Fritsch of Debian Security Team: ======================================================================= There is a race between renaming 950 if (!debug && rename(oldName, newName)) { a previous generation log file (say from "foo.1" to "foo.2") and opening a file with the old name ("foo.1") for writing. The open for write can happen both in copyTruncate() or in compressLogFile() at 302 outFile = createOutputFile(compressedName, O_RDWR | O_CREAT | O_TRUNC, sb); The fix would be to use O_EXCL. |