Bug 847339
| Summary: | logrotate ACL fix race condition | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Daniel Crisman <fixing-stuff-d-f-crisman-redhat-bugzilla> | ||||
| Component: | logrotate | Assignee: | Jan Kaluža <jkaluza> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Tomas Dolezal <todoleza> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.3 | CC: | azelinka, jorton, pmatouse, todoleza | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | logrotate-3.7.8-17.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: |
Cause: Both acl_set_fd() and fchmod() functions has been called to set the log files permissions.
Consequence: There was a race condition where the log file could have unsafe permissions for short time during its creation.
Fix: Only one of those functions is called now depending on directives combination used in configuration file.
Result: Race condition between these two functions is not possible anymore.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-07-18 09:35:14 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: | |||||||
| Attachments: |
|
||||||
Proposed patch should fix this issue if I'm right. It just moves acl_set_fd before the rename. I will do something like that in logrotate upstream version too and merge it with patch Bug 847338 patch. Created attachment 603970 [details]
patch
That patch reverses the race to between the line 256 acl_set_fd and the line 267 fchmod. But it still has a race condition. Also acl_set_fd will never get seen outside that race period so the ACL fix will not be there. I'm not sure I see the race condition in the patched code. Can you please explain it more? chmod and setfacl change overlapping data. If you do one and then the other in either order it is possible to have between the first call and the second more permissions then then end file has. This is fixed upstream and the patches can be backported. If "create" directive is used, fchmod is used. Otherwise, acl_set_fd is used. https://fedorahosted.org/logrotate/changeset/382 https://fedorahosted.org/logrotate/changeset/383 https://fedorahosted.org/logrotate/changeset/384 https://fedorahosted.org/logrotate/changeset/385 This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. 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. http://rhn.redhat.com/errata/RHBA-2013-1095.html |
Description of problem: Looks like a race condition in ACL change. Version-Release number of selected component (if applicable): From logrotate-3.7.8-15.el6.src.rpm In logrotate.c between Inside Line 1259 at line 258 rename() inside createOutputFile() and Line 1266 acl_set_fd Has the same style of race condition as bug 680798 (CVE-2011-1098) Might be similar issues before the other uses of acl_set_fd.