RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1214175 - abrt: does not honor dmesg_restrict
Summary: abrt: does not honor dmesg_restrict
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: abrt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: abrt
QA Contact: Martin Kyral
URL:
Whiteboard:
Depends On: 1128400
Blocks: 1211224 1214172
TreeView+ depends on / blocked
 
Reported: 2015-04-22 07:31 UTC by Florian Weimer
Modified: 2015-11-19 14:32 UTC (History)
2 users (show)

Fixed In Version: abrt-2.1.11-22.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1128400
Environment:
Last Closed: 2015-11-19 14:32:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2097 0 normal SHIPPED_LIVE abrt bug fix and enhancement update 2015-11-19 11:34:14 UTC

Description Florian Weimer 2015-04-22 07:31:36 UTC
+++ This bug was initially created as a clone of Bug #1128400 +++

Description of problem:
Kerneloops handlers can be called by any user by communicating directly with the journal unix socket and setting the analyzer as Kerneloops. When this analyzer is set then dmesg is called and dumped to the output dump directory. The dump file is given the permissions of the calling user, which allows any user to read dmesg.

The problem is that no appropriate checks or privilege dropping is done before calling dmesg.

How reproducible:
As long as bug is not duplicate (change type), always when the script is ran from any user.


Steps to Reproduce:
1. Set dmesg_restrict
2. Run attached Python script
3. Navigate to dump directory
4. View dmesg

Actual results:
$ cat /proc/sys/kernel/dmesg_restrict 
1

$ dmesg 
dmesg: read kernel buffer failed: Operation not permitted

$ cat /dev/kmsg 
cat: /dev/kmsg: Operation not permitted

$ python kerneloops.py

$ stat /var/tmp/abrt/dumpit-2014-08-09-23\:02\:36-1/dmesg 
..
Access: (0660/-rw-rw----)  Uid: ( 1001/ test)   Gid: (  173/    abrt)
...

Expected results:
Don't dump dmesg if calling user is restricted.

--- Additional comment from Murray McAllister on 2014-08-12 07:24:23 CEST ---

Hello,

Thank you for the report! I am going to get one of our kernel people to check this, whether it should be treated as a security flaw or just hardening.

Thanks,

--
Murray McAllister / Red Hat Product Security

--- Additional comment from Jakub Filak on 2014-11-11 10:29:53 CET ---

(In reply to Murray McAllister from comment #1)
Murray, any update on this bug report?

Should ABRT stop saving dmesg in the problem directories? Or should ABRT make the problem data accessible to root only if /proc/sys/kernel/dmesg_restrict is 1?

I prefer the latter option.

--- Additional comment from Murray McAllister on 2014-12-18 03:45:46 CET ---

Apologies for missing this and the long delay. From our kernel person:

"this could be treated more as a hardening issue than a security one. More so, it needs to be fixed on the abrtd side, as it provides the journal socket access to user applications to write log messages. without it, the reproducer does not work."

--- Additional comment from Murray McAllister on 2014-12-18 03:47:51 CET ---

I have asked someone to provide guidance on the question.

--- Additional comment from Josh Bressers on 2015-03-31 19:50:12 CEST ---

I'm removing the security flag from this bug. Fedora should not have embargoed issues and this should be opened up so it can be fixed.

--- Additional comment from  on 2015-04-17 18:08:50 CEST ---

With all of the new abrt issues going on around and other 'information disclosure' ones coming out, I figured I should update this ticket so it's in the list.

Comment 2 Jakub Filak 2015-07-09 10:41:06 UTC
The problem directories are accessible only to root users and users authorized via polkit.

distgit commit 5050e2a0eb82c167150af65e712a775bf9a1f447
Author: Jakub Filak <jfilak>
Date:   Tue May 5 15:42:37 2015 +0200

    Fix symlink, race-conditions and other security flaws
    
    Resolves: #1211969, #1212819, #1212863, #1212869
    Resolves: #1214453, #1214610, #1216973, #1218583

Comment 6 errata-xmlrpc 2015-11-19 14:32:39 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://rhn.redhat.com/errata/RHBA-2015-2097.html


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