From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B93EC433E9 for ; Wed, 13 Jan 2021 15:46:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0477C2339F for ; Wed, 13 Jan 2021 15:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbhAMPqr (ORCPT ); Wed, 13 Jan 2021 10:46:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:36738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbhAMPqr (ORCPT ); Wed, 13 Jan 2021 10:46:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67E37208BA; Wed, 13 Jan 2021 15:46:04 +0000 (UTC) Date: Wed, 13 Jan 2021 15:46:01 +0000 From: Catalin Marinas To: Andrey Konovalov Cc: Peter Collingbourne , Evgenii Stepanov , Kostya Serebryany , Vincenzo Frascino , Dave Martin , Will Deacon , Oleg Nesterov , "Eric W. Biederman" , "James E.J. Bottomley" , Linux ARM , Kevin Brodsky , linux-api@vger.kernel.org, Helge Deller , David Spickett Subject: Re: [PATCH v21 2/2] arm64: expose FAR_EL1 tag bits in siginfo Message-ID: <20210113154601.GB27045@gaia> References: <13cf24d00ebdd8e1f55caf1821c7c29d54100191.1605904350.git.pcc@google.com> <0010296597784267472fa13b39f8238d87a72cf8.1605904350.git.pcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Wed, Jan 13, 2021 at 03:51:42PM +0100, Andrey Konovalov wrote: > On Fri, Nov 20, 2020 at 9:34 PM Peter Collingbourne wrote: > > The kernel currently clears the tag bits (i.e. bits 56-63) in the fault > > address exposed via siginfo.si_addr and sigcontext.fault_address. However, > > the tag bits may be needed by tools in order to accurately diagnose > > memory errors, such as HWASan [1] or future tools based on the Memory > > Tagging Extension (MTE). > > > > Expose these bits via the arch_untagged_si_addr mechanism, so that > > they are only exposed to signal handlers with the SA_EXPOSE_TAGBITS > > flag set. > > > > [1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html > > > > Signed-off-by: Peter Collingbourne > > Reviewed-by: Catalin Marinas > > Link: https://linux-review.googlesource.com/id/Ia8876bad8c798e0a32df7c2ce1256c4771c81446 [...] > Not sure if it's expected, but this patch changes the way in-kernel > MTE faults are reported. The address of any in-kernel fault now gets > its top byte zeroed out, even though it was set to 0xf. However I > guess it's related to the fact that MTE always uses pointer tags in > 0x0_ format. Is this for _any_ faults or just MTE tag check faults? I tried the former and seems fine. Do you have a concrete example to make sure I understand the issue? -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F407C433E0 for ; Wed, 13 Jan 2021 15:47:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16BAA2339F for ; Wed, 13 Jan 2021 15:47:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16BAA2339F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ude+XxwKxb1oklmlkj7Iej+0EjPEHP+qljlKuJN4FEo=; b=wlL2HmOenaslzTismS6TIt+eU eF+1Hn8t3B15VGseevjtFLhrkD6EKtjP859IrXs4KazlgUQEYibCFmFjSOTkojhQXLtNQE/Sx4KM/ qYVRN/vV9RfTKOlZvYwJIKP0ToFVV6UVVW4y8xj67JlV4vHducjZCuDkNdXvDsbCzhH536P2wn0V9 WCj2llebFcmoKnlG/yru/OeKrijDx/Dj8mruN7h2ou9zcSL0z4CUH5+gOLgJ1ZMmo5yISpT8gxsuV RyNcgqKYWQFPqjaKIRl4e0YguIBbP2dHIiCek6yPVK5sXQnyGgXhQ151YFUaymNmagZF5FJatoT7z LHzNjDnYw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kziLa-0006nP-Sz; Wed, 13 Jan 2021 15:46:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kziLX-0006mF-L0 for linux-arm-kernel@lists.infradead.org; Wed, 13 Jan 2021 15:46:08 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67E37208BA; Wed, 13 Jan 2021 15:46:04 +0000 (UTC) Date: Wed, 13 Jan 2021 15:46:01 +0000 From: Catalin Marinas To: Andrey Konovalov Subject: Re: [PATCH v21 2/2] arm64: expose FAR_EL1 tag bits in siginfo Message-ID: <20210113154601.GB27045@gaia> References: <13cf24d00ebdd8e1f55caf1821c7c29d54100191.1605904350.git.pcc@google.com> <0010296597784267472fa13b39f8238d87a72cf8.1605904350.git.pcc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210113_104607_778656_EF2DFE56 X-CRM114-Status: GOOD ( 17.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Peter Collingbourne , Helge Deller , Kevin Brodsky , Oleg Nesterov , "James E.J. Bottomley" , Kostya Serebryany , "Eric W. Biederman" , linux-api@vger.kernel.org, David Spickett , Vincenzo Frascino , Will Deacon , Dave Martin , Evgenii Stepanov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 13, 2021 at 03:51:42PM +0100, Andrey Konovalov wrote: > On Fri, Nov 20, 2020 at 9:34 PM Peter Collingbourne wrote: > > The kernel currently clears the tag bits (i.e. bits 56-63) in the fault > > address exposed via siginfo.si_addr and sigcontext.fault_address. However, > > the tag bits may be needed by tools in order to accurately diagnose > > memory errors, such as HWASan [1] or future tools based on the Memory > > Tagging Extension (MTE). > > > > Expose these bits via the arch_untagged_si_addr mechanism, so that > > they are only exposed to signal handlers with the SA_EXPOSE_TAGBITS > > flag set. > > > > [1] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html > > > > Signed-off-by: Peter Collingbourne > > Reviewed-by: Catalin Marinas > > Link: https://linux-review.googlesource.com/id/Ia8876bad8c798e0a32df7c2ce1256c4771c81446 [...] > Not sure if it's expected, but this patch changes the way in-kernel > MTE faults are reported. The address of any in-kernel fault now gets > its top byte zeroed out, even though it was set to 0xf. However I > guess it's related to the fact that MTE always uses pointer tags in > 0x0_ format. Is this for _any_ faults or just MTE tag check faults? I tried the former and seems fine. Do you have a concrete example to make sure I understand the issue? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel