ptrace and kernel threads

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

 



H i all,

You will get an error when trying to call ptrace system call on kernel threads.

In code, you have the following check:
static int ptrace_attach(struct task_struct *task, long request,
                          unsigned long addr,
                          unsigned long flags)
 {
...
retval = -EPERM;
         if (unlikely(task->flags & PF_KTHREAD))
                 goto out;
...
see: http://lxr.free-electrons.com/source/kernel/ptrace.c#L233

Question: what is the reason that kernel threads cannot be traced while
userspace threads can be traced ?

rgs,
Kevin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux