From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 65BC8385770E; Tue, 16 May 2023 18:17:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65BC8385770E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684261044; bh=kik825HzAFsDzrE1jJEkTFfQmAXFD/tU9gLT4IEHd8E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HPfGH+LxRUyiPSSHIvFVAHh3ywiHCLMymHos8F3ORAPZe/OwxsHZJsczIQgmkHy9u fmAkCThCtFdQ3BS9mj7n0c1Aaz0TQOJuwjpkhQ7lHrzbj4CEqAeKZ0F1K1GnSalrkk 1V1jQYqHYzhGMBqbpiWGUAbFK6cpZlJjqjjQsSoY= From: "pedro at palves dot net" To: gdb-prs@sourceware.org Subject: [Bug server/30453] gdbserver cannot set breakpoints when /proc/pid/mem is not writable Date: Tue, 16 May 2023 18:17:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net X-Bugzilla-Status: UNCONFIRMED 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: Message-ID: In-Reply-To: References: 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=3D30453 --- Comment #2 from Pedro Alves --- What's the point of setting up a system such that a debugger can't write to= =20 inferior memory using /proc/pid/mem, but it can write via ptrace? That giv= es you no extra protection. I think the right fix is to just make it so that = the kernel allows writes if the calling process has ptrace permissions over the target pid, even if it prohibits other processes from writing. The workaround on the gdb side was for very old kernels, and for example wi= ll not work with non-stop mode, and of course does not support writing memory while threads are running (such as setting breakpoints), which was the poin= t of switching to /proc/pid/mem all the time. I would hope that with recent eno= ugh kernels things would just work reasonably. --=20 You are receiving this mail because: You are on the CC list for the bug.=