Bug 1885123

Summary: SELinux is preventing gdb from 'setattr' accesses on the soubor /var/lib/rpm/rpmdb.sqlite-wal.
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: dwalsh, fran, grepl.miroslav, ingmardelsink, lvrabec, mh, mmalik, plautrba, redhat, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ec3962e1365d7afe555bf1fb10ab8acd9714396f78d3414a5c831a1e237eddc8;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-02 08:00:30 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 Karel Volný 2020-10-05 06:52:52 UTC
Description of problem:
I got some crash report then this. I believe it is the same as already existing abrt bug, just this time for gdb process ...
SELinux is preventing gdb from 'setattr' accesses on the soubor /var/lib/rpm/rpmdb.sqlite-wal.

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

Pokud chcete opravit značku.
Výchozí značka pro /var/lib/rpm/rpmdb.sqlite-wal by měla být rpm_var_lib_t.
Then je možné spustit restorecon. Pokus o přístup byl pravděpodobně zastaven kvůli nedostatečným právům pro přístup do nadřazeného adresáře. V takovém případě se pokuste odpovídajícím způsobem změnit následující příkaz.
Do
# /sbin/restorecon -v /var/lib/rpm/rpmdb.sqlite-wal

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

Pokud chcete povolit gdb přístup typu setattr na rpmdb.sqlite-wal file
Then musíte změnit značku /var/lib/rpm/rpmdb.sqlite-wal
Do
# semanage fcontext -a -t TYP_SOUBORU '/var/lib/rpm/rpmdb.sqlite-wal'
kde TYP_SOUBORU je jeden z následujících: abrt_tmp_t, abrt_upload_watch_tmp_t, abrt_var_cache_t, abrt_var_log_t, abrt_var_run_t, kdump_crash_t, mail_home_rw_t, mnt_t, mock_var_lib_t, rhsmcertd_var_run_t, rpm_log_t, rpm_var_cache_t, rpm_var_run_t, usr_t.
Pak proveďte:
restorecon -v '/var/lib/rpm/rpmdb.sqlite-wal'


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

Pokud jste přesvědčeni, že má gdb mít ve výchozím stavu přístup setattr na rpmdb.sqlite-wal file.
Then měli byste tento problém nahlásit jako chybu.
Abyste přístup povolili, můžete vygenerovat lokální modul pravidel.
Do
prozatím tento přístup povolíte příkazy:
# 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                          <Neznámé>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            <Neznámé>
Local Policy RPM              selinux-policy-targeted-3.14.6-28.fc33.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.8.13-300.fc33.x86_64 #1 SMP Thu
                              Oct 1 20:49:47 UTC 2020 x86_64 x86_64
Alert Count                   7
First Seen                    2020-10-05 08:50:22 CEST
Last Seen                     2020-10-05 08:50:22 CEST
Local ID                      e06fa1ff-0768-4632-8185-239a08e2a1c0

Raw Audit Messages
type=AVC msg=audit(1601880622.653:547): avc:  denied  { setattr } for  pid=1984 comm="abrt-action-lis" name="rpmdb.sqlite-wal" dev="dm-0" ino=5505315 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,setattr


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

Comment 1 Zdenek Pytela 2020-10-05 07:19:12 UTC
Karle,

Do you know how did you get into this issue? Was is e. g. a system upgrade, or a database backend change?

Comment 2 Karel Volný 2020-10-05 08:19:03 UTC
(In reply to Zdenek Pytela from comment #1)
> Do you know how did you get into this issue? Was is e. g. a system upgrade,
> or a database backend change?

this is the first time I got it for gdb; before, I was getting it for abrt which I thought it was already reported, but I couldn't find it so I've created a new one - see bug 1885137

and I'm getting it since upgrade from F32 to F33

Comment 3 Karel Volný 2020-10-07 10:09:48 UTC
(In reply to Karel Volný from comment #2)
> ... I was getting it for abrt
> which I thought it was already reported, but I couldn't find it ...

because it was for abrt-action-sav (bug 1881163) while I got it for abrt-action-lis (bug 1885137)

Comment 4 Zdenek Pytela 2020-11-02 08:00:30 UTC

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