From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B156C3E9F8B for ; Thu, 7 May 2026 10:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778150938; cv=none; b=Wr64XBYIfqrWNzSN6KGvleSyGVPB7jZ4yNlabJ2CRb+Qw8QmLC2Sl02RGaR+y8n6c+HpjRMSzJqzG3ipw+7Um10xupOgRUuQFJsJNGBpEI4DzkTVDvFWL0xU/EpsMDEsw+dV5EExtxxxp2S+/Gmna7CXNlUPOSIBTO/aYoaxm94= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778150938; c=relaxed/simple; bh=PNzlkmzZAVB8U9xS0oKYg5xTf1GWvqR73uR9DaNDSFI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AzhIRDevdylH+jTcy5PfmHFuAoQZAnDZHYpEluv6sp7gTnFeILmz00jfHoWU6lpSMipvY2vOu4citunCZwLcEVOTZBilGH7qIEtMLEA+4p6iieUysVJaVoqWEW7g2rZbilUlgxXAWgfaw7jm31ysFyJ9x1HxXANujo6U3uZD8yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LmvWqIQE; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LmvWqIQE" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-488940ccfa6so72215e9.1 for ; Thu, 07 May 2026 03:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1778150933; x=1778755733; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OJoMClM82QzX+aGWXXRpJH1kO6RtFIoJ4NC0MWGce34=; b=LmvWqIQE+cml7xBGtmr5hEFIL5grYGFnAMJe9c2OwIwV1ceTlfFWlTTliLM/uJcKPg vsIDRc7EYzthGW0kSEeVIx9pzmQ3BJlFrexIguZ0Y67zLdmZX2Lk+PgV2h7m7Qnk+jHk njNI9ILsrMZ54IU9TRsIGfrigH9jj/BiFWrvq6nyG2HkFXnvtJCwaCqCpKnLZoKYAje+ 6T5WJazz4ZW4XNRb8IvgXuMga/g+UQSNthp3syKQ2G5SnIfwXbrlhEvbatyLr4Do6eMb CkWmNwiZQtSiYpB8RAT3kwzJDEys5922gwLbge8Wh47VNuTXKA3GMK5OdVmXi807+TBa d1Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778150933; x=1778755733; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OJoMClM82QzX+aGWXXRpJH1kO6RtFIoJ4NC0MWGce34=; b=pcKI0TKQUc99TpmZIGPoG0KrfBYZomE0nZqu4pHoNYAuoAT6iHfDFf3HCIk4CVwt+1 sEw3Do1agHMwqX1rVJqSCprDq8XyPGq2JAgT95VohWhTV/NRawsxn2+vYc4htjSMp5pR lB51PuCl+GquXN4uYSwlmiWtPW2u7ScSaP8k/sXqEcOxBBPvqFFEOqrS/5FfZyY6eldX 5OuOvSC4/7HHn00RqYjwL5BKXET6AcFzAgwPleLyyCcGIMWuP/AOhUxAhHM5UhjLCrU9 TEh7SR8O5bvsAkatSFd84TXFG+by1/wXrRSJkyCupWTzU6frwRz1LliJv1ZLyHlfnw7U gE7w== X-Forwarded-Encrypted: i=1; AFNElJ/QlBiZRUH9/GCEW0GdVOZ3IWcXHU9KST8URnTiEPGILH/+/RA2ek2UqH2okdxfa3lLxEMeuqTiArGz/vA=@vger.kernel.org X-Gm-Message-State: AOJu0YxvJhqV2zl+Y03u2//lXJMuj8oXtt81r4d/ilEIYW9lp0UznESt 4tlwxWUyJqToe9wPI1qjqmA97lv8lNdEmOP/CD/k4Ad7rRlU7/Oy34lYWUsThz5QAA== X-Gm-Gg: AeBDieuHgFXskggAANrxOM5o9PolWh4AeQZUlvo9OqUL2DuhbWtYEoqninLnPS8ouBa xQUiQiobHRQwOXhxzi1ETojSv7pAdApcHSxLvgNuI/HeoPWaqiIbzKn3zQUFneKFIMixrbzmSbN ONUek+fzzQLdReSwWNX5TeJYDRl2hDFgfBG4AeQQ7RwnQhSDlqBa4xq9yqat8cZDdwGxjTPqnna KlW1TOss0Fv9zdDjqIoP2TOPAzaZxHdxpWanzJdSd1WudhVWYdB35UmjVbZZvyMNMKYCIbWIgfR /gfGgAz5fjktbDsUGpZvSVMApwQt/Fej0j1DUbepYZ2u+vMrPdRUfggcXkWkKJ1iAFT6ump4yeH VqUD3NPRPKsBLwPC5UrExQdOVTBm5kYwtljIw8z6YHDVHoJFc/qZzPYxCbKaHuobP2ZMgL7BNiH DfCT9gF67hhOjpQBLp3IO/+us8gJ9IJwDeyO9LQExf3HKGoQbLlQNOuNW+Ao0tFT5hWCNMkWQW1 7PuDfW/u1QEAHAkp/E= X-Received: by 2002:a05:600c:48a1:b0:48a:5d55:c194 with SMTP id 5b1f17b1804b1-48e52ef8beemr1106625e9.7.1778150933019; Thu, 07 May 2026 03:48:53 -0700 (PDT) Received: from google.com (117.15.199.104.bc.googleusercontent.com. [104.199.15.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45054b02802sm19772180f8f.17.2026.05.07.03.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 03:48:52 -0700 (PDT) Date: Thu, 7 May 2026 10:48:46 +0000 From: Sebastian Ene To: Marc Zyngier Cc: catalin.marinas@arm.com, oupton@kernel.org, will@kernel.org, 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, vdonnefort@google.com, yuzenghui@huawei.com, Sudeep Holla Subject: Re: [PATCH] KVM: arm64: Forward FFA_NOTIFICATION* calls to TrustZone Message-ID: References: <20260501114447.2389222-2-sebastianene@google.com> <86wlxgy00t.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86wlxgy00t.wl-maz@kernel.org> On Wed, May 06, 2026 at 05:29:22PM +0100, Marc Zyngier wrote: Hello Marc, > [+ Sudeep] > > On Fri, 01 May 2026 12:44:48 +0100, > Sebastian Ene wrote: > > > > Remove the FFA_NOTIFICATION* calls from the blocklist used by the pKVM > > FF-A proxy. This restriction was preventing the use of asynchronous > > signaling mechanisms defined by the Arm FF-A specification to > > communicate with the secure services. > > While these calls are markes as optional, there is no reason why the > > hypervisor proxy would block them because: > > > > 1. Host is the Sole Non-Secure Endpoint: The Host operates as the > > only Non-Secure VM ID (VM ID 0) recognized by the Secure World. > > Where is this enforced? > There is no enforcement in place in the hypervisor since we don't proxy FF-A from guest VMs, there is only one non-secure user of this which is the host. > > Because all forwarded notifications are inherently attributed to > > the Host by the SPMC, there is no risk of VM ID spoofing > > originating from the Normal World. > > I don't understand: either the host is always using VM ID 0, and we > have ways to check and enforce this (how?), or the simple fact that > the request comes from NS is a guarantee that the SPMC will treat the > VM ID as 0. > > Which one is it? My understanding is that when the hypervisor doesn't handle the allocation of the non-secure IDs (through FFA_ID_GET), everything that comes from non-secure is treated as having the VM ID 0 by the SPMC. Thanks for having a look, Sebastian > > > > > 2. No Memory Pointers or Addresses: The FFA_NOTIFICATION_* ABIs > > operate strictly via register-based parameters, passing only > > VM IDs, VCPU IDs, flags, and bitmaps. Because these calls do > > not contain memory addresses, offsets, or pointers, forwarding > > them doesn't pose a risk of memory-based confused deputy attack > > (e.g., tricking the SPMC into overwriting protected memory). > > > > While the pKVM proxy behaves as a relayer, it doesn't currently have its > > own FF-A ID(only the host has the ID 0). The behavior of the setup > > flow is covered by the spec in the: '10.9 Notification support without > > a Hypervisor'. > > > > Signed-off-by: Sebastian Ene > > --- > > arch/arm64/kvm/hyp/nvhe/ffa.c | 8 -------- > > 1 file changed, 8 deletions(-) > > > > diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c > > index 1af722771178..a82d0cd22a17 100644 > > --- a/arch/arm64/kvm/hyp/nvhe/ffa.c > > +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c > > @@ -675,14 +675,6 @@ static bool ffa_call_supported(u64 func_id) > > case FFA_RXTX_MAP: > > case FFA_MEM_DONATE: > > case FFA_MEM_RETRIEVE_REQ: > > - /* Optional notification interfaces added in FF-A 1.1 */ > > - case FFA_NOTIFICATION_BITMAP_CREATE: > > - case FFA_NOTIFICATION_BITMAP_DESTROY: > > - case FFA_NOTIFICATION_BIND: > > - case FFA_NOTIFICATION_UNBIND: > > - case FFA_NOTIFICATION_SET: > > - case FFA_NOTIFICATION_GET: > > - case FFA_NOTIFICATION_INFO_GET: > > /* Optional interfaces added in FF-A 1.2 */ > > case FFA_MSG_SEND_DIRECT_REQ2: /* Optional per 7.5.1 */ > > case FFA_MSG_SEND_DIRECT_RESP2: /* Optional per 7.5.1 */ > > Shouldn't these be sanitised in a way? A bunch of registers are SBZ in > the spec, and I'd expect this to be enforced. > > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible.