Bug 2061211

Summary: SELinux is preventing abrt-action-sav from 'write' accesses on the file /usr/lib/sysimage/rpm/rpmdb.sqlite.
Product: [Fedora] Fedora Reporter: Ian Laurie <nixuser>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b3d4c1c71381ac66f81094d35c2af89c5b2ae00b2a9355f9ade60832ab5c7d82;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-14 12:02:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Laurie 2022-03-06 23:13:01 UTC
Description of problem:
SELinux is preventing abrt-action-sav from 'write' accesses on the file /usr/lib/sysimage/rpm/rpmdb.sqlite.

*****  Plugin restorecon (92.2 confidence) suggests   ************************

If you want to fix the label. 
/usr/lib/sysimage/rpm/rpmdb.sqlite default label should be rpm_var_lib_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /usr/lib/sysimage/rpm/rpmdb.sqlite

*****  Plugin catchall_boolean (7.83 confidence) suggests   ******************

If you want to allow all daemons to write corefiles to /
Then you must tell SELinux about this by enabling the 'daemons_dump_core' boolean.

Do
setsebool -P daemons_dump_core 1

*****  Plugin catchall (1.41 confidence) suggests   **************************

If you believe that abrt-action-sav should be allowed write access on the rpmdb.sqlite file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'abrt-action-sav' --raw | audit2allow -M my-abrtactionsav
# semodule -X 300 -i my-abrtactionsav.pp

Additional Information:
Source Context                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:root_t:s0
Target Objects                /usr/lib/sysimage/rpm/rpmdb.sqlite [ file ]
Source                        abrt-action-sav
Source Path                   abrt-action-sav
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            <Unknown>
Local Policy RPM              selinux-policy-targeted-36.3-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.17.0-0.rc5.102.fc36.x86_64 #1
                              SMP PREEMPT Mon Feb 21 19:16:16 UTC 2022 x86_64
                              x86_64
Alert Count                   1
First Seen                    2022-03-07 09:54:01 AEDT
Last Seen                     2022-03-07 09:54:01 AEDT
Local ID                      9cce8724-0591-4f16-bbe2-68fb371c1884

Raw Audit Messages
type=AVC msg=audit(1646607241.505:260): avc:  denied  { write } for  pid=1504 comm="abrt-action-sav" name="rpmdb.sqlite" dev="sda2" ino=283 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:root_t:s0 tclass=file permissive=0


Hash: abrt-action-sav,abrt_t,root_t,file,write


Additional info:
component:      selinux-policy
reporter:       libreport-2.17.0
hashmarkername: setroubleshoot
kernel:         5.17.0-0.rc5.102.fc36.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2022-03-14 12:02:35 UTC
It is required to turn this boolean on to execute the gdb handler and be able to troubleshoot further:

  # setsebool -P abrt_handle_event on

The underlying problem is being handled in
https://bugzilla.redhat.com/show_bug.cgi?id=2061141

*** This bug has been marked as a duplicate of bug 2061141 ***