All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Ene" <sebastianene@google.com>
Cc: "Oliver Upton" <oupton@kernel.org>,
	"Marc Zyngier" <maz@kernel.org>,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH v7 3/7] KVM: arm64: Support FFA_NOTIFICATION_UNBIND in host handler
Date: Mon, 29 Jun 2026 10:16:51 +0000	[thread overview]
Message-ID: <20260629101651.8742E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629093558.2425257-4-sebastianene@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The FFA_NOTIFICATION_UNBIND handler incorrectly treats the W2 parameter as a reserved field and forces it to be zero, which violates the FF-A specification and breaks valid unbind operations.
--

commit 607a657720d57d669adb319d0385db08fa611fcc
Author: Sebastian Ene <sebastianene@google.com>

KVM: arm64: Support FFA_NOTIFICATION_UNBIND in host handler

This commit adds support for the FFA_NOTIFICATION_UNBIND host handler by
verifying the arguments and forwarding the message to TrustZone. It extracts
the endpoint ID and verifies that the correct host FF-A ID is used before
allowing the unbind operation to proceed.

> diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c
> --- a/arch/arm64/kvm/hyp/nvhe/ffa.c
> +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c
[ ... ]
> @@ -897,6 +896,27 @@ static void do_ffa_notif_bind(struct arm_smccc_1_2_regs *res,
>  	hyp_smccc_1_2_smc(args, res);
>  }
>  
> +static void do_ffa_notif_unbind(struct arm_smccc_1_2_regs *res,
> +				struct kvm_cpu_context *ctxt)
> +{
> +	DECLARE_REG(u32, endp_id, ctxt, 1);
> +	DECLARE_REG(u32, reserved, ctxt, 2);
> +	struct arm_smccc_1_2_regs *args;
> +
> +	if (reserved) {
> +		ffa_to_smccc_res(res, FFA_RET_INVALID_PARAMETERS);
> +		return;
> +	}

[Severity: High]
Does this incorrectly reject valid unbind operations? The FF-A specification
defines W2 as the Notification ID(s) Low bitmap for unbind requests. 

By declaring W2 as reserved and forcing it to zero, it looks like this handler
prevents the host from unbinding any notifications that use the lower 32 bits
of the Notification ID bitmap.

Additionally, should there be an ffa_check_unused_args_sbz() call here to
verify the remaining unused registers are zeroed out, similar to the other
handlers?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260629093558.2425257-1-sebastianene@google.com?part=3

  reply	other threads:[~2026-06-29 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  9:35 [PATCH v7 0/7] KVM: arm64: Forward FFA_NOTIFICATION* calls to TrustZone Sebastian Ene
2026-06-29  9:35 ` [PATCH v7 1/7] KVM: arm64: Forward FFA_NOTIFICATION_BITMAP calls to Trustzone Sebastian Ene
2026-06-29  9:35 ` [PATCH v7 2/7] KVM: arm64: Support FFA_NOTIFICATION_BIND in host handler Sebastian Ene
2026-06-29  9:35 ` [PATCH v7 3/7] KVM: arm64: Support FFA_NOTIFICATION_UNBIND " Sebastian Ene
2026-06-29 10:16   ` sashiko-bot [this message]
2026-06-29  9:35 ` [PATCH v7 4/7] KVM: arm64: Support FFA_NOTIFICATION_SET " Sebastian Ene
2026-06-29 10:25   ` sashiko-bot
2026-06-29  9:35 ` [PATCH v7 5/7] KVM: arm64: Support FFA_NOTIFICATION_GET " Sebastian Ene
2026-06-29  9:35 ` [PATCH v7 6/7] KVM: arm64: Support FFA_NOTIFICATION_INFO_GET " Sebastian Ene
2026-06-29 12:46   ` sashiko-bot
2026-06-29  9:35 ` [PATCH v7 7/7] KVM: arm64: Enforce strict SBZ checks in the FF-A proxy Sebastian Ene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260629101651.8742E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastianene@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.