Bug 2090926 - error: state file /var/lib/logrotate/logrotate.status is world-readable and thus can be locked from other unprivileged users. Skipping lock acquisition
Summary: error: state file /var/lib/logrotate/logrotate.status is world-readable and t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-27 00:01 UTC by Harald Reindl
Modified: 2022-06-12 01:16 UTC (History)
4 users (show)

Fixed In Version: logrotate-3.20.1-2.fc37 logrotate-3.20.1-2.fc36 logrotate-3.18.1-4.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-01 01:24:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald Reindl 2022-05-27 00:01:30 UTC Comment hidden (abuse)
Comment 2 Kamil Dudka 2022-05-27 07:15:49 UTC
(In reply to Harald Reindl from comment #0)
> logrotate-3.18.1-3.fc35.x86_64
> 
> logrotate[2151]: error: state file /var/lib/logrotate/logrotate.status is
> world-readable and thus can be locked from other unprivileged users.
> Skipping lock acquisition...
> 
> besides i din't set that permissions anywhere the message is full nonsense
> how is a unprivileged user supposed to change a root-owned file with 640?

The state file used to have permissions 0644, which was problematic.  You are right that only owner (usually root) could change the file.  But anybody else was able to _lock_ the file using flock(1).  If the file is owned by root/root and has permission 0640, there is no problem there and the warning is not printed.

> and instead log such nonsense and break or whatever just "chmod 600>"
> the damend file and leave me in peace on dozens of machines

This should be harmless.  If you do not chmod the state file, the warning will be printed on the first rotation only.  The updated state file will be written with mode 0640, which prevents the warning from being printed in future runs.

(In reply to Jan Zizka from comment #1)
> This looks as CVE-2022-1348. If that is the case here are the patches, fixed in 3.20.0:
> - https://github.com/logrotate/logrotate/commit/1f76a381e2caa0603ae3dbc51ed0f1aa0d6658b9
> - https://github.com/logrotate/logrotate/commit/addbd293242b0b78aa54f054e6c1d249451f137d

To be clear, logrotate-3.18.1-3.fc35 has the patches applied and it is the reason why the warning is printed.

Comment 3 Harald Reindl 2022-05-27 07:37:22 UTC Comment hidden (abuse)
Comment 4 Jan Zizka 2022-05-27 07:46:05 UTC
(In reply to Kamil Dudka from comment #2)
> (In reply to Jan Zizka from comment #1)
> > This looks as CVE-2022-1348. If that is the case here are the patches, fixed in 3.20.0:
> > - https://github.com/logrotate/logrotate/commit/1f76a381e2caa0603ae3dbc51ed0f1aa0d6658b9
> > - https://github.com/logrotate/logrotate/commit/addbd293242b0b78aa54f054e6c1d249451f137d
> 
> To be clear, logrotate-3.18.1-3.fc35 has the patches applied and it is the
> reason why the warning is printed.

Ah yes, sorry I did miss the version. Thanks for clarification!

Comment 5 Kamil Dudka 2022-05-27 08:01:00 UTC
Good point, "error:" is misleading when it does not affect the exit code.  I have opened an upstream pull request to fix it:

    https://github.com/logrotate/logrotate/pull/448

Comment 8 Fedora Update System 2022-05-27 16:03:14 UTC
FEDORA-2022-28e51014ed has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-28e51014ed

Comment 9 Fedora Update System 2022-05-27 16:03:16 UTC
FEDORA-2022-14f7b1a698 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-14f7b1a698

Comment 10 Fedora Update System 2022-05-27 16:03:17 UTC
FEDORA-2022-ff0188b37c has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-ff0188b37c

Comment 11 Fedora Update System 2022-05-28 02:06:42 UTC
FEDORA-2022-28e51014ed has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-28e51014ed`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-28e51014ed

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2022-05-28 02:23:36 UTC
FEDORA-2022-ff0188b37c has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-ff0188b37c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-ff0188b37c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2022-05-28 02:39:32 UTC
FEDORA-2022-14f7b1a698 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-14f7b1a698`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-14f7b1a698

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2022-06-01 01:24:21 UTC
FEDORA-2022-28e51014ed has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2022-06-12 01:16:19 UTC
FEDORA-2022-ff0188b37c has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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