Bug 1122414 - SELinux is preventing /usr/bin/gdb from 'create' accesses on the file weakref.pyc.
Summary: SELinux is preventing /usr/bin/gdb from 'create' accesses on the file weakref...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: abrt
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: abrt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:bf0e0e1540641c15a07543545c0...
: 1122415 1122416 1122418 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-23 08:03 UTC by jaroslaw.herod
Modified: 2017-11-28 13:02 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 21:42:40 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1518224 None None None Never

Internal Links: 1518224

Description jaroslaw.herod 2014-07-23 08:03:59 UTC
Description of problem:
SELinux is preventing /usr/bin/gdb from 'create' accesses on the file weakref.pyc.

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

If aby gdb powinno mieć domyślnie create dostęp do weakref.pyc file.
Then proszę to zgłosić jako błąd.
Można utworzyć lokalny moduł polityki, aby umożliwić ten dostęp.
Do
można tymczasowo zezwolić na ten dostęp wykonując polecenia:
# grep gdb /var/log/audit/audit.log | audit2allow -M mojapolityka
# semodule -i mojapolityka.pp

Additional Information:
Source Context                system_u:system_r:abrt_t:s0-s0:c0.c1023
Target Context                system_u:object_r:lib_t:s0
Target Objects                weakref.pyc [ file ]
Source                        gdb
Source Path                   /usr/bin/gdb
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gdb-7.6.50.20130731-19.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-122.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.13.3-201.fc20.x86_64 #1 SMP Fri
                              Feb 14 19:08:32 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-02-24 21:22:17 CET
Last Seen                     2014-02-24 21:22:17 CET
Local ID                      fbd48e6f-035b-4866-9aa2-4cf1b2df004e

Raw Audit Messages
type=AVC msg=audit(1393273337.935:659): avc:  denied  { create } for  pid=13166 comm="gdb" name="weakref.pyc" scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=file


type=AVC msg=audit(1393273337.935:659): avc:  denied  { write } for  pid=13166 comm="gdb" path="/usr/lib64/python2.7/weakref.pyc" dev="dm-1" ino=406124 scontext=system_u:system_r:abrt_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=file


type=SYSCALL msg=audit(1393273337.935:659): arch=x86_64 syscall=open success=yes exit=ENOTBLK a0=104a810 a1=2c1 a2=81a4 a3=7f660dc865d0 items=0 ppid=13165 pid=13166 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=gdb exe=/usr/bin/gdb subj=system_u:system_r:abrt_t:s0-s0:c0.c1023 key=(null)

Hash: gdb,abrt_t,lib_t,file,create

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.15.6-200.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-07-23 09:46:57 UTC
*** Bug 1122415 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2014-07-23 09:47:09 UTC
*** Bug 1122416 has been marked as a duplicate of this bug. ***

Comment 3 Miroslav Grepl 2014-07-23 09:47:13 UTC
*** Bug 1122418 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Walsh 2014-08-06 22:49:37 UTC
THis is python trying to write a compiled object, any reason we are not shipping this file as compiled?

Comment 5 Jakub Filak 2014-08-07 08:07:36 UTC
If Python tried to write a compiled object for 
/usr/libexec/abrt-gdb-exploitable, then we are not shipping this file as compiled, because we though that GDB Python user commands are executable files and not Python modules.

ABRT uses that file in the following command:

gdb --batch \
    -ex 'python execfile("/usr/libexec/abrt-gdb-exploitable")' \
    -ex 'core-file ./coredump' \
    -ex 'abrt-exploitable 4 ./exploitable'

So, we should move it from /usr/libexec/ to /usr/share/abrt/gdb/, because the file should never be executed and also we should use ".py" suffix to tell rpm-build to compile it.

Jan, do you agree with me? Or are there any guidelines for shipping GDB Python commands?

Comment 6 Jan Kratochvil 2014-08-07 08:20:52 UTC
(In reply to Jakub Filak from comment #5)
> gdb --batch \
>     -ex 'python execfile("/usr/libexec/abrt-gdb-exploitable")' \
>     -ex 'core-file ./coredump' \
>     -ex 'abrt-exploitable 4 ./exploitable'
> 
> So, we should move it from /usr/libexec/ to /usr/share/abrt/gdb/, because
> the file should never be executed and also we should use ".py" suffix to
> tell rpm-build to compile it.

I understand neither Python nor SELinux but from all the problems of this kind I have seen I believe you should really do what you describe above.

Comment 7 Fedora End Of Life 2015-05-29 12:26:50 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 '20'.

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 20 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 8 Fedora End Of Life 2015-06-29 21:42:40 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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.