[Bug 1317136] [NEW] useful Yama EPERM error message missing (regression)

Kees Cook kees at ubuntu.com
Wed May 7 15:01:39 UTC 2014


Public bug reported:

Trusty's gdb and ltrace have lost the helpful error details when ptrace
attach fails. Compare to strace:

$ strace -p 1
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

$ gdb -p 1
GNU gdb (Ubuntu 7.7-0ubuntu3) 7.7
...
Attaching to process 1
ptrace: Operation not permitted.

$ ltrace -p 1
Cannot attach to pid 1: Operation not permitted


In Precise ltrace has the correct error (though gdb is still missing it -- this was lost quite some time ago it seems):

$ ltrace -p 1
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
Cannot attach to pid 1: Operation not permitted

** Affects: gdb (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: ltrace (Ubuntu)
     Importance: Undecided
         Status: New

** Also affects: ltrace (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1317136

Title:
  useful Yama EPERM error message missing (regression)

Status in “gdb” package in Ubuntu:
  New
Status in “ltrace” package in Ubuntu:
  New

Bug description:
  Trusty's gdb and ltrace have lost the helpful error details when
  ptrace attach fails. Compare to strace:

  $ strace -p 1
  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

  $ gdb -p 1
  GNU gdb (Ubuntu 7.7-0ubuntu3) 7.7
  ...
  Attaching to process 1
  ptrace: Operation not permitted.

  $ ltrace -p 1
  Cannot attach to pid 1: Operation not permitted

  
  In Precise ltrace has the correct error (though gdb is still missing it -- this was lost quite some time ago it seems):

  $ ltrace -p 1
  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
  Cannot attach to pid 1: Operation not permitted

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1317136/+subscriptions



More information about the foundations-bugs mailing list