From: sashiko-bot@kernel.org
To: "Christoph Schlameuss" <schlameuss@linux.ibm.com>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org, kvm@vger.kernel.org,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v5 21/21] KVM: s390: vsie: Enable use of VSIE SSCA
Date: Wed, 26 Aug 2026 15:33:39 +0000 [thread overview]
Message-ID: <20260826153339.B3F8B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826-vsie-sigpi-v5-21-cf471edb46b2@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] get_vsie_page_cpu_nr() erroneously wraps a positive return code (1) in ERR_PTR(), bypassing IS_ERR() checks and causing a host kernel panic.
- [High] VSIE SIGPI interpretation feature is globally enabled, bypassing KVM CPU feature negotiation and leaking the feature to nested guests.
- [High] get_vsie_sca() propagates validation and pinning errors as ERR_PTR(-EINVAL), crashing the VM instead of injecting an intercept.
--
commit accdb605c2c295d895867d6cf5f606b51df2bb5a
Author: Christoph Schlameuss <schlameuss@linux.ibm.com>
KVM: s390: vsie: Enable use of VSIE SSCA
This commit enables the use of VSIE SSCA code paths for handling SIGPI
and SRSI instructions without exiting VSIE. The feature defaults to true
on supported hardware.
> diff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c
> index a1ce75be3955b..ffa5bbb8713bc 100644
> --- a/arch/s390/kvm/s390/s390.c
> +++ b/arch/s390/kvm/s390/s390.c
[ ... ]
> @@ -3363,7 +3367,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
>
> kvm->arch.use_pfmfi = sclp.has_pfmfi;
> kvm->arch.use_skf = sclp.has_skey;
> - kvm->arch.use_ssca = sclp.has_vsie_interp_extf;
> + kvm->arch.use_ssca = sclp.has_vsie_interp_extf && ssca;
[Severity: High]
Does this bypass KVM CPU feature negotiation and leak the SSCA feature to
nested guests?
When ssca is enabled here, use_ssca() in arch/s390/kvm/s390/vsie.c relies
purely on kvm->arch.use_ssca:
arch/s390/kvm/s390/vsie.c:use_ssca() {
if (!kvm->arch.use_ssca)
return false;
...
}
The hardware intercept bits are then unconditionally copied to the shadow SCB
without validating the guest's CPU feature model:
arch/s390/kvm/s390/vsie.c:prepare_scb() {
...
if (vsie_page->vsie_sca) {
scb_s->eca |= scb_o->eca & ECA_SIGPI;
scb_s->ecb |= scb_o->ecb & ECB_SRSI;
...
}
Could this break live migration by exposing hardware features to the guest
without QEMU explicitly opting in via the KVM_S390_VM_CPU_FEAT_SIGPIF CPU
feature?
[Severity: Critical]
Does enabling this feature expose a host kernel panic when handling invalid
SCB addresses?
Enabling use_ssca routes execution to get_vsie_page_cpu_nr() in
kvm_s390_handle_vsie(). If an L1 guest provides an invalid SCB address,
init_vsie_page() injects a program interrupt and returns 1. However,
get_vsie_page_cpu_nr() wraps this positive return code in ERR_PTR:
arch/s390/kvm/s390/vsie.c:get_vsie_page_cpu_nr() {
...
rc = init_vsie_page(vcpu, vsie_page_new, scb_gpa);
if (rc) {
put_vsie_page(vsie_page);
return ERR_PTR(rc);
}
...
}
The caller then checks IS_ERR(vsie_page), which evaluates to false for a
positive value like (void*)1:
arch/s390/kvm/s390/vsie.c:kvm_s390_handle_vsie() {
...
vsie_page = get_vsie_page_cpu_nr(vcpu, vsie_sca, scb_addr,
scb_o->icpua & KVM_S390_CPU_MASK);
if (IS_ERR(vsie_page)) {
rc = PTR_ERR(vsie_page);
...
}
Will this allow execution to proceed and dereference the invalid pointer,
leading to a full host denial of service?
[Severity: High]
Can an invalid SCA origin provided by an L1 guest cause a complete VM abort?
Similar to the regression above, the newly reachable get_vsie_sca()
converts the return code 1 from validate_scao() into a hard -EINVAL error:
arch/s390/kvm/s390/vsie.c:get_vsie_sca() {
...
rc = validate_scao(vcpu, scb_o, sca_gpa);
if (rc)
return ERR_PTR(-EINVAL);
...
}
It also propagates pinning errors directly as hard errors rather than
injecting intercepts:
arch/s390/kvm/s390/vsie.c:get_vsie_sca() {
...
rc = pin_sca(kvm, vsie_sca);
if (rc) {
vsie_sca->sca_gpa = ULONG_MAX;
put_vsie_sca(vsie_sca);
vsie_sca = ERR_PTR(rc);
goto out;
}
...
}
These errors are propagated all the way up to kvm_arch_vcpu_ioctl_run(),
which returns -EINVAL to QEMU and aborts the entire VM. Is it
intended to crash the VM instead of gracefully resuming the guest with an
intercept when a misaligned or unmapped SCAO is encountered?
> spin_lock_init(&kvm->arch.start_stop_lock);
> kvm_s390_vsie_init(kvm);
> if (use_gisa)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260826-vsie-sigpi-v5-0-cf471edb46b2@linux.ibm.com?part=21
prev parent reply other threads:[~2026-08-26 15:33 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 15:05 [PATCH v5 00/21] KVM: s390: vsie: Add VSIE SIGP ECALL and SRSI Interpretation Christoph Schlameuss
2026-08-26 15:05 ` [PATCH v5 01/21] KVM: s390: vsie: Add SCAO read and write helpers Christoph Schlameuss
2026-08-26 15:12 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 02/21] KVM: s390: vsie: Move SCAO validation into a function Christoph Schlameuss
2026-08-26 15:15 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 03/21] KVM: s390: vsie: Add vsie_interp_extf detection Christoph Schlameuss
2026-08-26 15:12 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 04/21] KVM: s390: vsie: Add ssca_block and ssca_entry structs Christoph Schlameuss
2026-08-26 15:09 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 05/21] KVM: s390: vsie: Move pin/unpin guest page Christoph Schlameuss
2026-08-26 15:17 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 06/21] KVM: s390: vsie: Move pin/unpin_scb methods Christoph Schlameuss
2026-08-26 15:10 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 07/21] KVM: s390: vsie: Move release/acquire gmap shadow Christoph Schlameuss
2026-08-26 15:14 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 08/21] KVM: s390: vsie: Create helpers to alloc and free vsie_pages Christoph Schlameuss
2026-08-26 15:10 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 09/21] KVM: s390: vsie: Replace radix_tree with xarray addr_to_page Christoph Schlameuss
2026-08-26 15:14 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 10/21] KVM: s390: vsie: Refactor kvm_s390_vsie_destroy and extract reusable methods Christoph Schlameuss
2026-08-26 15:19 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 11/21] KVM: s390: vsie: Add helper reset_vsie_page() and unshadow_intercept() Christoph Schlameuss
2026-08-26 15:18 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 12/21] KVM: s390: vsie: Add helper unshadow_intercept() Christoph Schlameuss
2026-08-26 15:14 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 13/21] KVM: s390: vsie: Lazily keep original scb pinned after vsie exit Christoph Schlameuss
2026-08-26 15:25 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 14/21] KVM: s390: vsie: Add helper to pin and unpin multiple guest pages Christoph Schlameuss
2026-08-26 15:15 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 15/21] KVM: s390: vsie: Add struct vsie_sca with pin and unpin methods Christoph Schlameuss
2026-08-26 15:26 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 16/21] KVM: s390: vsie: Shadow VSIE SCA in guest-1 Christoph Schlameuss
2026-08-26 15:25 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 17/21] KVM: s390: vsie: Allow guest-3 cpu add and remove with ssca Christoph Schlameuss
2026-08-26 15:23 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 18/21] KVM: s390: vsie: Add VSIE max shadow configuration Christoph Schlameuss
2026-08-26 15:24 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 19/21] KVM: s390: vsie: Add VSIE shadow stat counters Christoph Schlameuss
2026-08-26 15:19 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 20/21] KVM: s390: vsie: Create minimal scb shadows for not running g3 blocks Christoph Schlameuss
2026-08-26 15:35 ` sashiko-bot
2026-08-26 15:05 ` [PATCH v5 21/21] KVM: s390: vsie: Enable use of VSIE SSCA Christoph Schlameuss
2026-08-26 15:33 ` sashiko-bot [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=20260826153339.B3F8B1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=schlameuss@linux.ibm.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.