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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 45AEDC2D0E4 for ; Tue, 24 Nov 2020 19:58:18 +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 AE7BE2053B for ; Tue, 24 Nov 2020 19:58:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AwqkFU8n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE7BE2053B 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=7cPHg8oyEk/9xdVwfB7YvW6B8NNP8lUQW6nYpED4Nyk=; b=AwqkFU8ny6E1hc9PdATeUN7E/ qP+8LadBDFaomcxOGiqvj5j4gGlQ9zloHE8ZdpX8PsLrWPODkjA1EeH4t/CU7WvCyXnqNAW5MnkYI gsOGH42FcnxJ+0a22VNEKctiVooUYe6sYGKxQiIxb6enCLV2mAfbc3zeH3nvts17Q8gR9T+/Nvc0t lcwB8I7CWuvfLA1MGB7hbKJr7mrNMlNT3uN9k7oYNV+FbaNWqVHj0w9v11peiBYnHTbZpk9zTajz6 ip0ytKcGUpaqYK1e3p+xXLEBgYKsAd7JE8s8IyKtg7aTlOPs0UpCGwFTu9fbDkAnXOr+ZxE9EdHW9 6OHO+5AYQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kheQq-0001hK-Ap; Tue, 24 Nov 2020 19:56:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kheQo-0001gy-1Q for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 19:56:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4952F1FB; Tue, 24 Nov 2020 11:56:52 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.26.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B1BE3F718; Tue, 24 Nov 2020 11:56:50 -0800 (PST) Date: Tue, 24 Nov 2020 19:56:47 +0000 From: Mark Rutland To: Peter Collingbourne Subject: Re: [PATCH] kasan: arm64: support specialized outlined tag mismatch checks Message-ID: <20201124195647.GD8957@C02TD0UTHF1T.local> References: <20201029205944.2769-1-pcc@google.com> <20201103152822.GF40454@C02TD0UTHF1T.local> <20201113112223.GA43992@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_145654_156453_A61CE474 X-CRM114-Status: GOOD ( 22.05 ) 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: Catalin Marinas , Mark Brown , Linux ARM , Andrey Konovalov , Will Deacon , 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 Fri, Nov 20, 2020 at 02:59:42PM -0800, Peter Collingbourne wrote: > On Fri, Nov 13, 2020 at 3:22 AM Mark Rutland wrote: > Hi Mark, > > I think all of your suggestions may be considered useful improvements > to the ABI, and if we were redesigning it from scratch then I think it > would look a lot more like what you've proposed. However, as discussed > out-of-band, the ABI is already being used in userspace, and has been > for over a year, and I don't think any of them rise to the level of > justifying creating a new ABI, in particular because they only affect > the uncommon case where we've actually detected an error. Sure, and apologies for the confusion here. I had sent this email just before that out-of-band conversation, and as mentioned there I wasn't aware this was an existing ABI. Given that, my main concerns are that this works correctly with PLTs (which as below, it should) and reliable stacktrace (which it appears it should as it affectively makes a tail-call), and that we thoroughly document the calling convention since it is surprising. I see you've sent a v2, and I'll follow up there. > > > For reference here is an example of a trampoline function for the kernel: > > > > > > __hwasan_check_x1_67043328: > > > sbfx x16, x1, #4, #52 > > > ldrb w16, [x9, x16] > > > cmp x16, x1, lsr #56 > > > b.ne .Ltmp5 > > > .Ltmp6: > > > ret > > > .Ltmp5: > > > lsr x16, x1, #56 > > > cmp x16, #255 > > > b.eq .Ltmp6 > > > stp x0, x1, [sp, #-256]! > > > stp x29, x30, [sp, #232] > > > mov x0, x1 > > > mov x1, #0 > > > b __hwasan_tag_mismatch > > > > Thanks for this; it was helpful in clarifying my understanding. > > > > I note this clobbers x16 unconditionally. Is x17 free for use too? > > Yes, and indeed it must be free for use because the linker is allowed > to clobber x16 and x17 across the call via a range extension thunk > (that said, I don't know what ld.bfd does, but ld.lld just clobbers > x16). Sure, that range extension thunk or PLT was exactly what I was concerned with, since I wasn't sure which portions of the usual AAPCS rules were being respected here. Thanks for confirming! Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel