From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7F06A3858429; Thu, 21 Mar 2024 13:00:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F06A3858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711026034; bh=n74c+mPkFzYoh1bCSRTDMPea0btYC4oEsHT5EktxaNs=; h=From:To:Subject:Date:From; b=U2Slg2JsOqf1sBIqnu66jkdlTZpnR8LY7DVbz0tDqGMuw54MBcZweYYecmUWsP525 WOz5gdwczX4NvHGpQtG+R6m/66hw4JZN/HEc20+n57DWIrLT8TNiKaeClyRKpHDlBr 88u4aSwXHWvU2yDrtndwO9nqORrxmDMWU5XebK8o= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug external/31520] New: [gdb/external] Handle kernel.yama.ptrace_scope != 0 Date: Thu, 21 Mar 2024 13:00:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: external X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31520 Bug ID: 31520 Summary: [gdb/external] Handle kernel.yama.ptrace_scope !=3D 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 $USE= R, 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=3D"cap_setpcap,cap_setuid,cap_setgid+ep cap_sys_ptrace+eip" --keep=3D1 --user=3D"$USER" --addamb=3D"cap_sys_ptrace" --shell=3D/usr/bin/gdb -- -p ... 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 ot= her tools than gdb who would need the same script), and delivered to users or n= ot, 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=