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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17EE3F9EDC0 for ; Wed, 22 Apr 2026 12:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z/VKe2lI6CPGeoMQ62GshEgGgWxT2JxGGIYjISrbAJ0=; b=dId+Nz2kvhHCyxWnmrSfi+JO6l d11lju6bckv+pJ5OrdrfnDkSMdieBnIH4Q1WugqVv2h1JPMBcEDiCuiSZQx2kCBs2/MrwOFANZOxH v92C3qDYo2ODVfQuA+NfP7iRAT5elKQIaitErvIP/1Oalhqn01elQcIWkXk7w7j2SYarvmJK3P3m2 LXAN6oJDzKTQKR7doyTcPst8pwTUOyHWsylsOZ4IQfxMMLZrmqByu1Cw3/0iLLet5O9z9Y10eHS7y RssQy9IO544XdrrB5YJkCYXAFVRGuxN1F4n9HYpXvyPttDjJ7JYEeLt0iBZTtwIl0CMVUetzrLsF7 SxePW7Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wFWch-0000000A2Ha-3vg4; Wed, 22 Apr 2026 12:24:08 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wFWcf-0000000A2HE-3MN8 for linux-arm-kernel@lists.infradead.org; Wed, 22 Apr 2026 12:24:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 5C470441C4; Wed, 22 Apr 2026 12:24:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A467C2BCAF; Wed, 22 Apr 2026 12:24:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776860645; bh=l5HPtZdlzSBeRHgZlDAbvmn6MVD1vR7K3Uu4k9nyR9Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e578lAGQ+Fg6ZvLTWzoT+GQ2MehhXLNdSzbj7qcHRDwu7SJ+BE1+6FqztmYRJk680 DPT1XsS+PzKVm1juKmi5wMOQs3i/qENfqCT//alxXzLFm/2yq3VtilEoTsRD23PgWk rLQidccwPRuALwLacXadSc4+7A00QRIX7Z4ehBvHlhiYUwDyLmUQVLqLPjD9j7S9qY H1ZAbhGdyk+vPddMj1SLT2lbQ4pIqTz0o0rv9bErThmyC0EMEoNYD5MSDqvsO/vums 29jQ0TbcLruDF7CeTyXowRjqxboDW0j2uaHEkxs9Sw97CgBwR37ATOhYfF8YVlLVLY HIY0WDOFYYwXw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFWcc-0000000DjM4-3nNT; Wed, 22 Apr 2026 12:24:02 +0000 Date: Wed, 22 Apr 2026 13:24:02 +0100 Message-ID: <86bjfb18v1.wl-maz@kernel.org> From: Marc Zyngier To: Sebastian Ene Cc: oupton@kernel.org, will@kernel.org, ayrton@google.com, catalin.marinas@arm.com, joey.gouly@arm.com, korneld@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, mrigendra.chaubey@gmail.com, perlarsen@google.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, stable@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Validate the FF-A memory access descriptor placement In-Reply-To: <20260422102540.1433704-1-sebastianene@google.com> References: <20260422102540.1433704-1-sebastianene@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sebastianene@google.com, oupton@kernel.org, will@kernel.org, ayrton@google.com, catalin.marinas@arm.com, joey.gouly@arm.com, korneld@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, mrigendra.chaubey@gmail.com, perlarsen@google.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, stable@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260422_052405_860272_A11011D4 X-CRM114-Status: GOOD ( 18.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 22 Apr 2026 11:25:40 +0100, Sebastian Ene wrote: > > Prevent the pKVM hypervisor from making assumptions that the > endpoint memory access descriptor (EMAD) comes right after the > FF-A memory region header and enforce a strict placement for it > when validating an FF-A memory lend/share transaction. As I read this, you want to remove a bad assumption... > > Prior to FF-A version 1.1 the header of the memory region > didn't contain an offset to the endpoint memory access descriptor. > The layout of a memory transaction looks like this: > > Field name | Offset > -- 0 > [ Header (ffa_mem_region) |__ ep_mem_offset > EMAD 1 (ffa_mem_region_attributes) | > ] > > Reject the host from specifying a memory access descriptor offset > that is different than the size of the memory region header. And yet you decide that you want to enforce this assumption. I don't understand how you arrive to this conclusion. Looking at the spec, it appears that the offset is *designed* to allow a gap between the header and the EMAD. Refusing to handle a it seems to be a violation of the spec. What am I missing? M. -- Without deviation from the norm, progress is not possible.