From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH v3 19/23] arm64: mte: Add PTRACE_{PEEK,POKE}MTETAGS support Date: Wed, 13 May 2020 18:11:35 +0100 Message-ID: <20200513171134.GE2719@gaia> References: <20200421142603.3894-1-catalin.marinas@arm.com> <20200421142603.3894-20-catalin.marinas@arm.com> <20200513104849.GC2719@gaia> <3d2621ac-9d08-53ea-6c22-c62532911377@linaro.org> <20200513141147.GD2719@gaia> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from foss.arm.com ([217.140.110.172]:50822 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbgEMRLj (ORCPT ); Wed, 13 May 2020 13:11:39 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Luis Machado Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , Vincenzo Frascino , Szabolcs Nagy , Richard Earnshaw , Kevin Brodsky , Andrey Konovalov , Peter Collingbourne , linux-mm@kvack.org, linux-arch@vger.kernel.org, Alan Hayward , Omair Javaid On Wed, May 13, 2020 at 01:45:27PM -0300, Luis Machado wrote: > On 5/13/20 12:09 PM, Luis Machado wrote: > > Let me think about this for a bit. I'm trying to factor in the > > /proc//maps contents. If debuggers know which pages have PROT_MTE > > set, then we can teach the tools not to PEEK/POKE tags from/to those > > memory ranges, which simplifies the error handling a bit. > > I was checking the output of /proc//maps and it doesn't seem to contain > flags against which i can match PROT_MTE. It seems /proc//smaps is the > one that contains the flags (mt) for MTE. Am i missing something? You are right, the smaps is the one with the MTE information. > Is this the only place debuggers can check for PROT_MTE? If so, that's > unfortunate. /proc//smaps doesn't seem to be convenient for parsing. We can't change 'maps' as it's a pretty standard format with rwxp properties only. If you don't want to check any /proc file, just attempt to read the tags and check the ptrace return code. The downside is that you can't easily probe if a process is using MTE or not. But is this piece of information relevant? The gdb user should know what to look for (well, it's been a while since I used a debugger ;)). -- Catalin