public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug external/31520] New: [gdb/external] Handle kernel.yama.ptrace_scope != 0
@ 2024-03-21 13:00 vries at gcc dot gnu.org
  2024-03-21 13:28 ` [Bug external/31520] " vries at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-21 13:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31520

            Bug ID: 31520
           Summary: [gdb/external] Handle kernel.yama.ptrace_scope != 0
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: external
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

openSUSE Tumbleweed recently changed the default of the
kernel.yama.ptrace_scope setting from 0 to 1.

This causes attach-type test-cases to fail.

For me, it's easily fixable by manually overriding the default in say
/etc/sysctl.conf or /etc/sysctl.d/10-ptrace.conf.

But there may be users who either don't want to do this, or are not allowed to
do this on the system at hand.

Using sudo should still work, but that may also be considered unacceptable, or
an inconvenience because the user really wants to be debugging as user $USER,
not as root.

I found this link (  https://wiki.archlinux.org/title/Capabilities ) which
advertises a way to still run as user, while having increased priviliges:
...
$ sudo -E capsh --caps="cap_setpcap,cap_setuid,cap_setgid+ep
cap_sys_ptrace+eip" --keep=1 --user="$USER" --addamb="cap_sys_ptrace"
--shell=/usr/bin/gdb -- -p <pid>
...

This does not yet work for me on openSUSE Leap 15.4, I need to debug this
further.

But it occurred to me that:
- this setting and problem is unmentioned in our docs, and
- that a script that supports allowing ptrace capabilities that would work on
  any linux system (or indicate why not) would be useful.

Whether this script should be part of the gdb contrib scripts (there are other
tools than gdb who would need the same script), and delivered to users or not,
I'm not sure.  But it would be good to have it somewhere, and to be able to
point to its location in the docs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-25 13:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21 13:00 [Bug external/31520] New: [gdb/external] Handle kernel.yama.ptrace_scope != 0 vries at gcc dot gnu.org
2024-03-21 13:28 ` [Bug external/31520] " vries at gcc dot gnu.org
2024-03-21 14:33 ` vries at gcc dot gnu.org
2024-03-21 16:52 ` vries at gcc dot gnu.org
2024-03-21 17:43 ` vries at gcc dot gnu.org
2024-03-22 14:16 ` vries at gcc dot gnu.org
2024-03-23  8:15 ` sam at gentoo dot org
2024-03-25 13:46 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).