Description of problem:
Looks like a race condition in ACL change.
Version-Release number of selected component (if applicable):
In logrotate.c between
Inside Line 1259 at line 258
rename() inside createOutputFile()
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.
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]
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.
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.