Red Hat Bugzilla – Bug 802072
SELinux deny_ptrace: Do not restrict PTRACE_TRACEME
Last modified: 2016-07-26 00:44:37 EDT
+++ This bug was initially created as a clone of Bug #786878 +++
New feature coming in Fedora 17 will allow users to disable ptrace and sys_ptrace access on an SELinux system.
--- Additional comment from email@example.com on 2012-03-07 00:13:27 CET ---
Jan is right, it would make more sense to allow one to trace their children. But such permissions will require a kernel change. I assume that's what you meant. We can probably steal the similar logic from YAMA...
Note to self for implementation:
Requires a new policy capability so we check old ptrace permission if policy doesn't yet support the new PTRACE_CHILD permission. The allow/deny unknown work is only adequate when restricting thing further (aka new permission) instead of changing the semantics of or reducing the scope of current permissions.
--- Additional comment from firstname.lastname@example.org on 2012-03-07 14:12:14 CET ---
It would be significantly simpler to just change the existing selinux_ptrace_traceme() hook to use a different permission (if the corresponding policy capability was defined) so that it can be distinguished in policy. That seems to be all they need, not the general ability to PTRACE_ATTACH to an arbitrary descendant.
*** Bug 802065 has been marked as a duplicate of this bug. ***
A proposed patch seems to get included in Rawhide (http://lists.fedoraproject.org/pipermail/kernel/2012-April/003732.html). No confirmation on F-17 yet?
(In reply to comment #2)
> A proposed patch seems to get included in Rawhide
> (http://lists.fedoraproject.org/pipermail/kernel/2012-April/003732.html). No
> confirmation on F-17 yet?
There now. Will be in the next F17 update. Bodhi will leave a comment in the bug when it's available in a repo.
kernel-3.3.2-1.fc17 has been submitted as an update for Fedora 17.
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-3.3.2-1.fc17'
as soon as you are able to, then reboot.
Please go to the following url:
then log in and leave karma (feedback).
[root@f17 ~]# cat /proc/version
Linux version 3.3.2-1.fc17.x86_64 (email@example.com) (gcc version 4.7.0 20120322 (Red Hat 4.7.0-1) (GCC) ) #1 SMP Fri Apr 13 20:23:49 UTC 2012
[root@f17 ~]# getsebool deny_ptrace
deny_ptrace --> on
[root@f17 ~]# gdb -q true -ex run
Reading symbols from /usr/bin/true...(no debugging symbols found)...done.
Starting program: /usr/bin/true
Cannot create process: Permission denied
warning: the SELinux boolean 'deny_ptrace' is enabled, you can disable this process attach protection by: (gdb) shell sudo setsebool deny_ptrace=0
During startup program exited with code 127.
Missing separate debuginfos, use: debuginfo-install coreutils-8.15-6.fc17.x86_64
Eric, any thoughts on Jan's issues?
Needs a policy update to make use of the kernel change. Dan, do we want to try it?
kernel-3.3.2-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
It is not yet CLOSED as discussed here.
The kernel part is done at least. Reassigning to selinux-policy per comment #8.
Still working on it, waiting for F17 to be released.
I expected the goal is to fix bugs _before_ a Fedora release.
(In reply to comment #14)
> I expected the goal is to fix bugs _before_ a Fedora release.
Technically, it's not going to be a bug that anyone hits by default. The deny_ptrace stuff defaults to off at this point in the release.
First we are in freeze, and I consider this an enhancement not a bug. The deny_ptrace it turned off by default. Since the definition of deny_ptrace was to disable all ptrace this is not a bug. We have to figure out what the best mechanism for allowing a user to secure his machine. We need a three way mechanism to setup the system.
Don't deny user ptrace (Same default as F16).
Deny ptrace of processes but allow ptrace of children.
Deny all Ptrace.
If I as the administrator decide I want no ptrace on my machine, I should be able to state this. I am thinking about adding another boolean which would allow ptrace child.
> Deny ptrace of processes but allow ptrace of children.
"of children" is not sufficient. As explained on the mailing list, you need to also support the YAMA registration API for DrKonqi, WINE etc. to work.
Once the kernel supports it we will support it.
We're not going to enable YAMA.
You need to support something equivalent or deny_ptrace is just plain not usable.
(and I don't care whether it's implemented by reusing YAMA or by doing your own thing in the SELinux code)
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 WONTFIX if it remains open with a Fedora
'version' of '17'.
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 prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 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 to Fedora 17's end of life.
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.
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.
(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)
More information and reason for this action is here:
Just a ping too see if ptrace child was implemented, I'm trying to get chrome running properly with my user set to staff_u and it wanting sys_ptrace (hopefully only on it's child processes).
The ptrace_child code has been removed from the kernel and we should probably remove the process:ptrace_child permission from policy - Miroslav?
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.