Bug 1565834 - SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/*
Summary: SELinux is preventing gdb from write access on the directory /usr/share/gdb/p...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-10 21:12 UTC by Michal Ambroz
Modified: 2019-10-23 21:56 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:48:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michal Ambroz 2018-04-10 21:12:11 UTC
Description of problem:
When some application crashes - abrt daemon tries to run gdb. SELinux prevents GDB to recompile some python libraries which are in the  directory /usr/share/gdb/python/* directories and which are not compiled with the pyo objects.

Version-Release number of selected component (if applicable):
gdb-8.0.1-36.fc27.x86_64
selinux-policy-3.13.1-283.30.fc27.noarch
selinux-policy-targeted-3.13.1-283.30.fc27.noarch

# rpm -qf /usr/share/gdb/python/exploitable/lib/analyzers
gdb-exploitable-1.32-2.20170717git35b742d.fc27.noarch

# rpm -qf /usr/share/gdb/python/gdb/types.py
gdb-headless-8.0.1-36.fc27.x86_64


How reproducible:
100% during service crash of service running in targeted mode

Steps to Reproduce:
1. dnf -y install gdb-headless gdb-exploitable
2. crash some service which runs in targeted mode
3. watch journalctl -f for the errors from SELinux 

Actual results:
crash

Expected results:
it is expected that gdb willrun without issues to analyze the crashing service.

Additional info:
Apr 10 22:35:59 myhostname.example.com abrt-notification[2641]: Process 28472 (glib-pacrunner) crashed in JS_AbortIfWrongThread(JSRuntime*)()
Apr 10 22:36:01 myhostname.example.com dbus-daemon[1348]: [system] Activating service name='org.fedoraproject.Setroubleshootd' requested by ':1.280' (uid=0 pid=1312 comm="/usr/sbin/sedispatch " label="system_u:system_r:audisp_t:s0") (using servicehelper)
Apr 10 22:36:02 myhostname.example.com dbus-daemon[1348]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Apr 10 22:36:02 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:02 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the lib directory 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
                                                             
Apr 10 22:36:03 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:03 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the lib directory 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
                                                             
Apr 10 22:36:03 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:03 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the lib directory 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
                                                             
Apr 10 22:36:04 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:04 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the lib directory 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
                                                             
Apr 10 22:36:04 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:04 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the lib directory 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
                                                             
Apr 10 22:36:05 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:05 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:05 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:05 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:05 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:05 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:06 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:06 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:06 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:06 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:07 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:07 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/gdb_wrapper.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the gdb_wrapper directory 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
                                                             
Apr 10 22:36:07 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:07 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the analyzers directory 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
                                                             
Apr 10 22:36:08 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:08 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the analyzers directory 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
                                                             
Apr 10 22:36:08 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:08 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the analyzers directory 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
                                                             
Apr 10 22:36:09 myhostname.example.com setroubleshoot[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers. For complete SELinux messages run: sealert -l ceae2643-26d6-4a69-aa2e-0c1f2a7b79c0
Apr 10 22:36:09 myhostname.example.com python3[2678]: SELinux is preventing gdb from write access on the directory /usr/share/gdb/python/exploitable/lib/analyzers.
                                                             
                                                             *****  Plugin catchall (100. confidence) suggests   **************************
                                                             
                                                             If you believe that gdb should be allowed write access on the analyzers directory 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

Comment 1 Lukas Vrabec 2018-04-13 16:12:00 UTC
Hi, 

Could you reproduce the issue and after that attach output of: 

# ausearch -m AVC -ts recent 

THanks,
Lukas.

Comment 2 Ben Cotton 2018-11-27 14:25:42 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Ben Cotton 2018-11-30 22:48:54 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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