Bug 1899959 - SELinux is preventing gdb from 'write' accesses on the file /var/lib/rpm/rpmdb.sqlite-wal.
Summary: SELinux is preventing gdb from 'write' accesses on the file /var/lib/rpm/rpmd...
Keywords:
Status: CLOSED DUPLICATE of bug 1461313
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 33
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:19f9626a2ab13390ee759a22a27...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-20 13:16 UTC by Daniel Demus
Modified: 2020-11-20 13:57 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-20 13:57:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Demus 2020-11-20 13:16:30 UTC
Description of problem:
This haååens about 500 times on login to gnome. I assume dnf update or gnome software is updating in the background.
SELinux is preventing gdb from 'write' accesses on the file /var/lib/rpm/rpmdb.sqlite-wal.

*****  Plugin restorecon (94.8 confidence) suggests   ************************

If you want to fix the label. 
/var/lib/rpm/rpmdb.sqlite-wal 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 /var/lib/rpm/rpmdb.sqlite-wal

*****  Plugin catchall_labels (5.21 confidence) suggests   *******************

If you want to allow gdb to have write access on the rpmdb.sqlite-wal file
Then you need to change the label on /var/lib/rpm/rpmdb.sqlite-wal
Do
# semanage fcontext -a -t FILE_TYPE '/var/lib/rpm/rpmdb.sqlite-wal'
where FILE_TYPE is one of the following: abrt_etc_t, abrt_tmp_t, abrt_upload_watch_tmp_t, abrt_var_cache_t, abrt_var_log_t, abrt_var_run_t, afs_cache_t, initrc_tmp_t, kdump_crash_t, mail_home_rw_t, mock_var_lib_t, postfix_postdrop_t, puppet_tmp_t, rhsmcertd_var_run_t, rpm_log_t, rpm_var_cache_t, rpm_var_run_t, sysfs_t, user_cron_spool_t, user_tmp_t, usr_t.
Then execute:
restorecon -v '/var/lib/rpm/rpmdb.sqlite-wal'


*****  Plugin catchall (1.44 confidence) suggests   **************************

If you believe that gdb should be allowed write access on the rpmdb.sqlite-wal 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 'gdb' --raw | audit2allow -M my-gdb
# semodule -X 300 -i my-gdb.pp

Additional Information:
Source Context                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                /var/lib/rpm/rpmdb.sqlite-wal [ file ]
Source                        gdb
Source Path                   gdb
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            <Unknown>
Local Policy RPM              selinux-policy-targeted-3.14.6-30.fc33.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.8.18-300.fc33.x86_64 #1 SMP Mon
                              Nov 2 19:09:05 UTC 2020 x86_64 x86_64
Alert Count                   537
First Seen                    2020-11-15 16:29:51 CET
Last Seen                     2020-11-20 14:05:20 CET
Local ID                      f8e878ff-78c7-41d4-a4eb-4d5e4e8c3b9b

Raw Audit Messages
type=AVC msg=audit(1605877520.992:618): avc:  denied  { write } for  pid=2461 comm="abrt-action-lis" name="rpmdb.sqlite-wal" dev="dm-0" ino=456 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=0


Hash: gdb,abrt_t,var_lib_t,file,write


Additional info:
component:      selinux-policy
reporter:       libreport-2.14.0
hashmarkername: setroubleshoot
kernel:         5.8.18-300.fc33.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2020-11-20 13:57:24 UTC

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


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