Bug 801606 (selinux_ptrace) - SELinux is preventing /usr/bin/gdb from using the 'ptrace' accesses on a process.
Summary: SELinux is preventing /usr/bin/gdb from using the 'ptrace' accesses on a proc...
Keywords:
Status: CLOSED NOTABUG
Alias: selinux_ptrace
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:4b35674c4327a4643d14828f0df...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-08 23:36 UTC by Barry Godusky
Modified: 2012-08-13 14:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-09 14:49:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Barry Godusky 2012-03-08 23:36:24 UTC
libreport version: 2.0.8
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.3.0-0.rc6.git0.2.fc17.x86_64
reason:         SELinux is preventing /usr/bin/gdb from using the 'ptrace' accesses on a process.
time:           Thu 08 Mar 2012 06:36:03 PM EST

description:
:SELinux is preventing /usr/bin/gdb from using the 'ptrace' accesses on a process.
:
:*****  Plugin catchall_boolean (89.3 confidence) suggests  *******************
:
:If you want to deny_ptrace
:Then you must tell SELinux about this by enabling the 'deny_ptrace'boolean.
:Do
:setsebool -P deny_ptrace 0
:
:*****  Plugin catchall (11.6 confidence) suggests  ***************************
:
:If you believe that gdb should be allowed ptrace access on processes labeled unconfined_t 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:
:# grep gdb /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                unconfined_u:unconfined_r:unconfined_t:s0
:Target Context                unconfined_u:unconfined_r:unconfined_t:s0
:Target Objects                 [ process ]
:Source                        gdb
:Source Path                   /usr/bin/gdb
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           gdb-7.4.50.20120120-28.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-95.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.3.0-0.rc6.git0.2.fc17.x86_64 #1 SMP Mon Mar 5
:                              16:54:07 UTC 2012 x86_64 x86_64
:Alert Count                   3
:First Seen                    Thu 08 Mar 2012 05:41:08 PM EST
:Last Seen                     Thu 08 Mar 2012 06:34:46 PM EST
:Local ID                      059d38cb-3358-4d7c-9682-e9104aeda79e
:
:Raw Audit Messages
:type=AVC msg=audit(1331249686.474:3312): avc:  denied  { ptrace } for  pid=29218 comm="gdb" scontext=unconfined_u:unconfined_r:unconfined_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process
:
:
:type=SYSCALL msg=audit(1331249686.474:3312): arch=x86_64 syscall=ptrace success=no exit=EACCES a0=10 a1=5d84 a2=0 a3=0 items=0 ppid=25154 pid=29218 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm=gdb exe=/usr/bin/gdb subj=unconfined_u:unconfined_r:unconfined_t:s0 key=(null)
:
:Hash: gdb,unconfined_t,unconfined_t,process,ptrace
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-03-09 14:49:29 UTC
The alert tells you what to do, We have a bugzilla open on gdb to tell you this also, and hope to get a change into the kernel where

gdb EXEC 

Is legal and

gdb -P PID 

Is illegal with the boolean turned on.

Comment 2 Mikhail 2012-08-04 11:54:58 UTC
Why this alert happens? I have such alert,

Comment 3 Mikhail 2012-08-05 13:47:08 UTC
Recently, I have this alert several times a day. This did not exist before. what happens?

Comment 4 Mikhail 2012-08-05 13:57:10 UTC
I have Fedora 17 installed on four computers, this alert appears only on one.

Comment 5 Daniel Walsh 2012-08-06 14:39:30 UTC
MikHail what AVC's are you seeing?  What is the setting of deny_ptrace

getsebool deny_ptrace

Comment 6 Mikhail 2012-08-06 18:48:14 UTC
$ getsebool deny_ptrace
deny_ptrace --> on

Comment 7 Daniel Walsh 2012-08-13 14:38:28 UTC
So if you want to allow this you would have to turn off the deny_ptrace.


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