Bug 245529

Summary: drkonqi fails when PTRACE restrictions are active
Product: [Frameworks and Libraries] kdelibs Reporter: Kees Cook <kees>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: fix to declare PTRACE relationship

Description Kees Cook 2010-07-23 11:51:22 UTC
Version:           SVN (using Devel) 
OS:                Linux

Startgin with Ubuntu 10.10, PTRACE is limited to only direct descendants.  Exceptions can be declared on a process-by-process basis using prctl.  The attached patch makes sure that drkonqi can still process KDE application crashes.

Reproducible: Always

Steps to Reproduce:
$ kate &
...
$ kill -SEGV $(pidof kate)

Actual Results:  
Drkonqi will not show backtraces, and will report gdb errors on stderr.

Expected Results:  
Drkonqi will report backtrace normally.

Adding prctl(PR_SET_PTRACER, pid, 0, 0, 0) will fix this in the seg handler.
Comment 1 Kees Cook 2010-07-23 11:53:10 UTC
Created attachment 49426 [details]
fix to declare PTRACE relationship

Patch attached to fix this.  (Note that this is harmless for systems that do not use PTRACE restrictions.)
Comment 2 Jonathan Riddell 2010-12-15 18:02:13 UTC
SVN commit 1206730 by jriddell:

Description: declare the process that will be debugging the crashed KDE app.
Author: Kees Cook <kees@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/589841
BUG:245529


 M  +5 -0      kcrash.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1206730
Comment 3 Jonathan Riddell 2010-12-15 18:03:25 UTC
SVN commit 1206732 by jriddell:

backport 1206730
Description: declare the process that will be debugging the crashed KDE app.
Author: Kees Cook <kees@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/589841
BUG: 245529


 M  +5 -0      kcrash.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1206732
Comment 4 David Faure 2010-12-15 22:30:08 UTC
SVN commit 1206787 by dfaure:

Fix compilation on everything else than linux.
Instead of a cmake check, we can just say "if linux" for the linux-specific call, this is simpler.
CCMAIL: jr@jriddell.org
CCBUG: 245529


 M  +5 -0      kcrash.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1206787