Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ptrace(PT_DUMPCORE) permission?



On 21.08.2020 17:10, Patrick Welche wrote:
> pbulk was idle stuck building kio at
> 
> dbus    24339  0.0  0.0 182156   9644 pts/6  Il   12:45PM   0:00.04 /usr/pkg/bin/cmake -E cmake_autogen /tmp/pkgsrc/devel/kio/work/kio-5.70.1/_KDE_build/src/urifilters/ikws/CMakeFiles/kurisearchfilter_autogen.dir/AutogenInfo.json  
> 
> Trying to debug:
> 
> # gcore -c cmake.core 24339
> gcore: ptrace(PT_DUMPCORE) to 24339 failed: Permission denied
> # gcore 24339
> gcore: ptrace(PT_ATTACH) to 24339 failed: No such process
> 
> Permission denied? and sure enough after that, there was no process.
> 

There is a general bug in ptrace(PT_ATTACH) that checks permissions on
behalf of the dumping process. For example, once a child sets
RLIMIT_CORE to 0, you cannot attach to it and dump the core.

> Thoughts on giving root permission? (I should have just gdb attached...)
> 

Other ptrace(2) semantics are not affected with the current NetBSD behavior.

New GDB (upcoming in base / pkgsrc), gained gdb-gcore support that uses
ptrace(PT_DUMPCORE), thus suffers from the same problem.

> 
> Cheers,
> 
> Patrick
> 


Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index