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 1491585 - Allow /usr/sbin/abrt-harvest-vmcore capabilities for /var/crash
Summary: Allow /usr/sbin/abrt-harvest-vmcore capabilities for /var/crash
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.4
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1546167 (view as bug list)
Depends On:
Blocks: 1446410 1546167 1653106
TreeView+ depends on / blocked
 
Reported: 2017-09-14 08:32 UTC by Martin Kutlak
Modified: 2019-08-06 12:52 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 12:51:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2127 0 None None None 2019-08-06 12:52:06 UTC

Description Martin Kutlak 2017-09-14 08:32:29 UTC
Description of problem:
abrt-addon-vmcore has an option to move (copy then delete) vmcores, by setting 'CopyVMcore' to 'no' under /etc/abrt/plugins/vmcore.conf.

But SELinux is preventing /usr/sbin/abrt-harvest-vmcore from deleting vmcores from /var/crash dir. 


Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-166.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Configure kdump and set default dump path to /var/crash

2. Install abrt along with its addon abrt-addon-vmcore

3. Set copyvmcore=no under /etc/abrt/plugins/vmcore.conf

4. Restart abrt-vmcore.service

5. Crash the system

Actual results:
abrt-harvest-vmcore: Unable to delete '/var/crash/127.0.0.1-2017-09-12-10:25:49'. Ignoring

SELinux is preventing /usr/bin/python2.7 from write access on the directory 127.0.0.1-2017-09-12-10:25:49.

Additional info:
type=AVC msg=audit(1505294459.205:166): avc:  denied  { write } for  pid=1715 comm="abrt-harvest-vm" name="127.0.0.1-2017-09-12-10:25:49" dev="dm-0" ino=44716 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kdump_crash_t:s0 tclass=dir

Comment 2 Milos Malik 2017-10-17 11:32:32 UTC
Could you re-run your scenario in permissive mode? I expect additional SELinux denials to be logged, for example: { add_name } and { create }.

Comment 3 Martin Kutlak 2017-10-17 12:47:26 UTC
You were right. I've rerun the scenario with permissive mode and got these:

1)
Additional Information:
Source Context                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:kdump_crash_t:s0
Target Objects                127.0.0.1-2017-10-17-14:37:22 [ dir ]
Source                        abrt-harvest-vm
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           python-2.7.5-58.el7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-166.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 3.10.0-693.el7.x86_64
                              #1 SMP Thu Jul 6 19:56:57 EDT 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-10-17 14:37:37 CEST
Last Seen                     2017-10-17 14:37:37 CEST
Local ID                      b90f3b24-23f8-43b3-91a9-938cdedd8b66

Raw Audit Messages
type=AVC msg=audit(1508243857.827:114): avc:  denied  { write } for  pid=1491 comm="abrt-harvest-vm" name="127.0.0.1-2017-10-17-14:37:22" dev="dm-0" ino=44641 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kdump_crash_t:s0 tclass=dir


type=AVC msg=audit(1508243857.827:114): avc:  denied  { remove_name } for  pid=1491 comm="abrt-harvest-vm" name="vmcore-dmesg.txt" dev="dm-0" ino=44650 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kdump_crash_t:s0 tclass=dir


type=AVC msg=audit(1508243857.827:114): avc:  denied  { unlink } for  pid=1491 comm="abrt-harvest-vm" name="vmcore-dmesg.txt" dev="dm-0" ino=44650 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kdump_crash_t:s0 tclass=file


type=SYSCALL msg=audit(1508243857.827:114): arch=x86_64 syscall=unlink success=yes exit=0 a0=f1c410 a1=0 a2=1 a3=fffffff0 items=0 ppid=1 pid=1491 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=abrt-harvest-vm exe=/usr/bin/python2.7 subj=system_u:system_r:abrt_t:s0-s0:c0.c1023 key=(null)


2)
Raw Audit Messages
type=AVC msg=audit(1508243857.830:115): avc:  denied  { rmdir } for  pid=1491 comm="abrt-harvest-vm" name="127.0.0.1-2017-10-17-14:37:22" dev="dm-0" ino=44641 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:kdump_crash_t:s0 tclass=dir


type=SYSCALL msg=audit(1508243857.830:115): arch=x86_64 syscall=rmdir success=yes exit=0 a0=f1c620 a1=0 a2=1 a3=fffffff0 items=0 ppid=1 pid=1491 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=abrt-harvest-vm exe=/usr/bin/python2.7 subj=system_u:system_r:abrt_t:s0-s0:c0.c1023 key=(null)

Comment 6 Milos Malik 2018-09-12 18:52:43 UTC
Following rule (mentioned in comment#3) is missing:

allow abrt_t kdump_crash_t : dir { rmdir };

# rpm -qa selinux\*
selinux-policy-targeted-3.13.1-225.el7.noarch
selinux-policy-doc-3.13.1-225.el7.noarch
selinux-policy-minimum-3.13.1-225.el7.noarch
selinux-policy-mls-3.13.1-225.el7.noarch
selinux-policy-3.13.1-225.el7.noarch
selinux-policy-sandbox-3.13.1-225.el7.noarch
selinux-policy-devel-3.13.1-225.el7.noarch
#

Comment 9 Lukas Vrabec 2018-11-08 13:21:46 UTC
*** Bug 1546167 has been marked as a duplicate of this bug. ***

Comment 10 Lukas Vrabec 2019-01-31 14:36:56 UTC
commit d5ee2354148e66167aff265c0dfe6e4098b98455 (HEAD -> rhel7.7-contrib)
Author: Lukas Vrabec <lvrabec>
Date:   Thu Jan 31 15:35:45 2019 +0100

    Update kdump_manage_crash() interface to allow also manage dirs by caller domain
    Resolves: rhbz#1491585

Comment 17 errata-xmlrpc 2019-08-06 12:51:45 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://access.redhat.com/errata/RHBA-2019:2127


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