From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49B4E386C594; Thu, 15 Feb 2024 19:06:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49B4E386C594 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708024001; bh=bt+CBNBvxM/Q3jXUrsTVH4ZGXj13/4V3MiWqYcygmZE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lDWyaaYfhVpCnGjwzaGo8I+hMqVmMjR7ooxmPFnShKQLMjQGxFDl46ZLBqx4jMvFt cEEHRxrmaZ1dRfJMtkr5US3XJORp2Tm0PO/qmX1BahTBoDcbsn/pj5TpABI0+Kofhl L0DIQDptyTng2lVjdqyUqb1m/pmrBUaMTghAQ9Wg= From: "adrian.ratiu at collabora dot com" To: gdb-prs@sourceware.org Subject: [Bug server/30453] gdbserver cannot set breakpoints when /proc/pid/mem is not writable Date: Thu, 15 Feb 2024 19:06:39 +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: adrian.ratiu at collabora dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 Adrian Ratiu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrian.ratiu at collabora = dot com --- Comment #8 from Adrian Ratiu --- Hello, sorry for necro-bumping this, but I'm working on Chromebooks on beha= lf of Collabora and encountered this problem - of not having a functional remo= te debugger past GDB 9.2 (yes CrOS based systems are still using v9.2...). I got GDB working again by creating a kernel patch as you suggested above, = to relax the /proc/pid/mem hardening restriction for ptrace-scoped processes, = but it got rejected by ChromiumOS upstream as too risky. Please see the attached kernel patch and this reply [1] if you want more details on that. I also wrote a patch for gdbserver which adds back the the ptrace r/w as a fallback which works nicely for my test cases. I've attached the patch and tried to explain as best I can in the commit message. Please consider the perspective of ChromeOS/ChromiumOS users, for which use= rs GDB has a regression because basic functionality used to work and is broken= in more recent releases. Would the gdbserver patch be acceptable to fix this case? I can modify it if necessary to make it acceptable, for example after writing it I noticed that gdb/linux-nat.c contains proc_mem_file_is_writable () which does something similar, maybe I could reuse that logic? Thanks, Adrian=20 [1] https://issuetracker.corp.google.com/issues/268356054#comment61 --=20 You are receiving this mail because: You are on the CC list for the bug.=