From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9E9B7385783F; Tue, 16 May 2023 18:24:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E9B7385783F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684261496; bh=AMQV4joWd78Ze+jmLgQyxR6o0ngXWkENtO2QHEqtTes=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mp+yzEoIu05FfeaerN+n93aeMwwAooAJjrb9tbP/olhZ56mGKelVRiEIW+XlJhaKe 0/UV/PwJt+GYPHeQ3z5Ur5jLVeg9pShVLldREJQ2ecUHizRDNzH6UnUBfEUo5vLujv EaE7cudUoVbZk3A+gNXC+VqBiuCjZJTyHYCQwNiI= From: "manojgupta at google dot com" 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:24:56 +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: manojgupta at google dot com 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 #3 from Manoj Gupta --- Unfortunately, writes to /proc/pid/mem has been disabled for a long time as part of security hardening as it has been used in security expolits. Please feel free to check the bugs https://bugs.chromium.org/p/chromium/issues/detail?id=3D766253 and https://bugs.chromium.org/p/chromium/issues/detail?id=3D781376 .=20 Ptrace is also discussed in that bug. It is lesser of an issue because the devices use seccomp filters for most critical and do not allow ptrace sysca= ll to be used. ``` sure, if you have ptrace scope on a process, it def leaves it open to arbit= rary read/writes of any memory region. the difference there is that it requires= you to be within a specific scope (as you noted), and you need to be able to ac= cess the ptrace syscall. that's a much higher barrier than accessing the "mem" = file which can be hit with a simple `dd` fork+exec. when it comes to seccomp filters, we have the ability to run daemons/proces= ses through restrictive syscall filters, and we have yet to include ptrace ther= e.=20 off the top of my head, the only valid use of ptrace on the system is in upstart itself (which uses it for process tracking). it might be interesti= ng to severely restrict ptrace so only pid 1 (init) is allowed to use it. ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=