From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 967723CAE61; Wed, 22 Apr 2026 12:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776860645; cv=none; b=W4bFthFDugRCWvPF3cjQVqL8jM1pT4Bn7iwSNr18ryjJCnWXQaL9gll+xUYteI46X762TjLkgA7WAbsi4q+QfSp1Ia0PpPVFFe/wrHRHi+54eSrYJ62anvXO5IEAO2SWI+hPYlZJNHARyhKeVkxnRwU6njRWPpfeogOElnaeNJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776860645; c=relaxed/simple; bh=l5HPtZdlzSBeRHgZlDAbvmn6MVD1vR7K3Uu4k9nyR9Y=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=UoFXpgNlJerhrPSuXe7Tg79lCG4vkzL0csx4kci4i3cbboHb6U4rvXqFQ8UfgwFR75Eok+34NjQOXPyNc+8ZxqGaXPcnmeR2MqJSiOycg9qv9DOZ1pSUvydQxlgwTiai+ig0svXEaea5MNggYL/F3EjcqCtPF/garYwd9qavA/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e578lAGQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e578lAGQ" 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) Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.