From: Marc Zyngier <maz@kernel.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: Oliver Upton <oupton@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Quentin Perret <qperret@google.com>,
Stefan Teodorescu <fane@google.com>,
tabba@google.com, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: Validate the SVE vector length in pkvm_vcpu_init_sve()
Date: Tue, 18 Aug 2026 13:51:24 +0100 [thread overview]
Message-ID: <86fr0b6183.wl-maz@kernel.org> (raw)
In-Reply-To: <20260818093117.2379344-1-fuad.tabba@linux.dev>
On Tue, 18 Aug 2026 10:31:17 +0100,
Fuad Tabba <fuad.tabba@linux.dev> wrote:
>
> pkvm_vcpu_init_sve() clamps only the upper bound of the host-provided
> sve_max_vl, so an invalid vector length reaches sve_state_size_from_vl()
> and the WARN_ON() there, which is fatal at EL2. The existing
> !sve_state_size test rejects such a length, but only after the macro has
> run.
>
> Check sve_vl_valid() before deriving the state size. A valid length
> cannot yield a zero size, so the !sve_state_size test goes with it.
>
> Fixes: 5db1bef93342 ("KVM: arm64: Track SVE state in the hypervisor vcpu structure")
> Reported-by: Stefan Teodorescu <fane@google.com>
> Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
prev parent reply other threads:[~2026-08-18 12:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 9:31 [PATCH] KVM: arm64: Validate the SVE vector length in pkvm_vcpu_init_sve() Fuad Tabba
2026-08-18 12:51 ` Marc Zyngier [this message]
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=86fr0b6183.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=fane@google.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oupton@kernel.org \
--cc=qperret@google.com \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox