Bug 1936305

Summary: SELinux is preventing gdb from 'read' accesses on the chr_file card0.
Product: [Fedora] Fedora Reporter: Matt Fagnani <matt.fagnani>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: anang.w120879, dwalsh, grepl.miroslav, jwadodson, lvrabec, mmalik, omosnace, plautrba, vmojzis, zpytela, zuurveldt
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:1037e9e314ab8138adb0012eefe42ba0707b90646a2c0eda6dc7588ca6af7dc7;VARIANT_ID=kde;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-31 20:34:12 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 Matt Fagnani 2021-03-08 07:10:38 UTC
Description of problem:
gdb has been denied reading card0 which I guess is the GPU device file /dev/dri/card0 labelled dri_device_t. These denial happened at least 3 times each when abrt has been processing crashes in various graphical programs such as the following.
gnome-shell when logging out https://bugzilla.redhat.com/show_bug.cgi?id=1936229
drkonqi when trying to input a description of a crash https://bugzilla.redhat.com/show_bug.cgi?id=1930946
backintime-qt when closing https://bugzilla.redhat.com/show_bug.cgi?id=1844781

The latest such denials happened when using Plasma 5.21.2 or GNOME 40 beta in a Fedora 34 KDE Plasma spin installation with selinux-policy-targeted-3.14.7-24.fc34.noarch in enforcing mode. setroubleshoot showed that this denial was first seen on 2020-11-08 in Fedora 33.


SELinux is preventing gdb from 'read' accesses on the chr_file card0.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that gdb should be allowed read access on the card0 chr_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:dri_device_t:s0
Target Objects                card0 [ chr_file ]
Source                        gdb
Source Path                   gdb
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.7-24.fc34.noarch
Local Policy RPM              selinux-policy-targeted-3.14.7-24.fc34.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.11.3-300.fc34.x86_64 #1 SMP Thu
                              Mar 4 19:03:18 UTC 2021 x86_64 x86_64
Alert Count                   184
First Seen                    2020-11-08 22:21:28 EST
Last Seen                     2021-03-07 17:50:02 EST
Local ID                      b43d3839-6ee1-4508-ac94-b55afdfafb0a

Raw Audit Messages
type=AVC msg=audit(1615157402.642:1000): avc:  denied  { read } for  pid=12639 comm="gdb" name="card0" dev="devtmpfs" ino=449 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dri_device_t:s0 tclass=chr_file permissive=0


Hash: gdb,abrt_t,dri_device_t,chr_file,read

Version-Release number of selected component:
selinux-policy-targeted-3.14.7-24.fc34.noarch

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

Potential duplicate: bug 1896648

Comment 1 Real Name 2021-03-23 16:15:21 UTC
Similar problem has been detected:

whenever a crash happens, this pops up along with abrt

hashmarkername: setroubleshoot
kernel:         5.11.8-300.fc34.x86_64
package:        selinux-policy-targeted-3.14.7-26.fc34.noarch
reason:         SELinux is preventing gdb from 'read' accesses on the chr_file card0.
type:           libreport

Comment 2 Zdenek Pytela 2021-03-31 20:34:12 UTC

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

Comment 3 Anang Wahyudi 2021-07-06 03:06:25 UTC
*** Bug 1979434 has been marked as a duplicate of this bug. ***

Comment 4 John Dodson 2021-08-08 12:10:14 UTC
*** Bug 1991222 has been marked as a duplicate of this bug. ***

Comment 5 John Dodson 2021-08-09 01:32:00 UTC
*** Bug 1991307 has been marked as a duplicate of this bug. ***

Comment 6 John Dodson 2021-08-10 00:16:10 UTC
*** Bug 1991772 has been marked as a duplicate of this bug. ***

Comment 7 John Dodson 2021-08-21 01:53:36 UTC
*** Bug 1996236 has been marked as a duplicate of this bug. ***

Comment 8 John Dodson 2021-08-25 07:50:06 UTC
*** Bug 1997409 has been marked as a duplicate of this bug. ***