strace cannot attach to process despite being root and setting scope

Bug #1495706 reported by Mario Vietri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-lts-utopic (Ubuntu)
New
Undecided
Unassigned

Bug Description

I am trying to run `strace` against kworker, but I cannot attach strace despite havingset ptrace_scope=0 and being root.

Here is the proof:

root@rasal:/home/me# whoami
root
root@rasal:/home/me# cat /proc/sys/kernel/yama/ptrace_scope
0
root@rasal:/home/me# ps ax | grep kworker
    5 ? S< 0:00 [kworker/0:0H]
   31 ? S< 0:00 [kworker/1:0H]
   35 ? S 0:00 [kworker/2:0]
   36 ? S< 0:00 [kworker/2:0H]
   41 ? S< 0:00 [kworker/3:0H]
   58 ? S 0:00 [kworker/1:1]
   76 ? S 0:00 [kworker/3:1]
   78 ? S 0:00 [kworker/1:2]
   79 ? S 0:00 [kworker/2:1]
  149 ? S 0:00 [kworker/0:1]
  162 ? S 0:00 [kworker/u16:3]
  163 ? S 0:00 [kworker/u16:4]
  164 ? S 0:00 [kworker/u16:5]
  448 ? S< 0:00 [kworker/3:1H]
  449 ? S< 0:00 [kworker/1:1H]
  451 ? S< 0:00 [kworker/2:1H]
  452 ? S< 0:00 [kworker/0:1H]
  560 ? S 0:00 [kworker/3:2]
  604 ? S 0:00 [kworker/0:2]
 1006 ? S< 0:00 [kworker/u17:0]
 1017 ? S< 0:00 [kworker/u17:1]
 4222 ? S 0:00 [kworker/3:0]
 4249 pts/4 S+ 0:00 grep --color=auto kworker
root@rasal:/home/me# strace -p 4222
strace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
root@rasal:/home/me# uname -a
Linux rasal 3.16.0-49-generic #65~14.04.1-Ubuntu SMP Wed Sep 9 10:03:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Any info on this?

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: linux-image-3.16.0-49-generic 3.16.0-49.65~14.04.1
ProcVersionSignature: Ubuntu 3.16.0-49.65~14.04.1-generic 3.16.7-ckt15
Uname: Linux 3.16.0-49-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.13
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Sep 15 00:01:12 2015
InstallationDate: Installed on 2014-05-05 (497 days ago)
InstallationMedia: Kubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.1)
SourcePackage: linux-lts-utopic
UpgradeStatus: Upgraded to trusty on 2014-11-21 (297 days ago)

Revision history for this message
Mario Vietri (mario-vietri) wrote :
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.