From: sashiko-bot@kernel.org
To: "Claudio Imbrenda" <imbrenda@linux.ibm.com>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
kvm@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [GIT PULL v1 17/17] KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject
Date: Mon, 15 Jun 2026 13:23:00 +0000 [thread overview]
Message-ID: <20260615132301.583DE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260615124243.187614-18-imbrenda@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Guest-reachable WARN_ON_ONCE during memory allocation failure in `__kvm_inject_pfault_token`
- [High] Preexisting guest-triggerable WARN_ON_ONCE on interrupt queue full
--
commit 4b098d22649d526ad54d46d65ab883c23baf1ae2
Author: Douglas Freimuth <freimuth@linux.ibm.com>
KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject
This commit introduces a fast path for irq injection to prevent blocking on
the global work queue. It also converts shared resources between the fast and
slow paths to spinlocks and adds statistical counters for analysis.
Message-ID: <20260604192755.203143-4-freimuth@linux.ibm.com>
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 9265bc73cd938..dc9c7451fe979 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
[ ... ]
> @@ -4429,19 +4439,28 @@ int kvm_s390_try_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clo
> }
>
> static void __kvm_inject_pfault_token(struct kvm_vcpu *vcpu, bool start_token,
> - unsigned long token)
> + unsigned long token)
> {
> struct kvm_s390_interrupt inti;
> struct kvm_s390_irq irq;
> + struct kvm_s390_interrupt_info *inti_mem = NULL;
> + int ret = 0;
>
> if (start_token) {
> irq.u.ext.ext_params2 = token;
> irq.type = KVM_S390_INT_PFAULT_INIT;
> WARN_ON_ONCE(kvm_s390_inject_vcpu(vcpu, &irq));
> } else {
> + inti_mem = kzalloc_obj(*inti_mem, GFP_KERNEL_ACCOUNT);
> + if (WARN_ON_ONCE(!inti_mem))
> + return;
[Severity: High]
This isn't a bug introduced by this patch, but does this guest-reachable
assertion pose a denial of service risk? Under host memory pressure, this
allocation can fail. Since a guest can trigger async page faults (and thus
host memory allocations) by accessing swapped-out memory, an unprivileged
guest could exhaust memory limits to force this allocation to fail. This
would intentionally hit the WARN_ON_ONCE, potentially crashing the host if
panic_on_warn is enabled.
> +
> inti.type = KVM_S390_INT_PFAULT_DONE;
> inti.parm64 = token;
> - WARN_ON_ONCE(kvm_s390_inject_vm(vcpu->kvm, &inti));
> + ret = kvm_s390_inject_vm(vcpu->kvm, &inti, inti_mem);
> + if (ret)
> + kfree(inti_mem);
> + WARN_ON_ONCE(ret);
[Severity: High]
This is a pre-existing issue, but could this assertion also be driven by a
malicious guest? A guest can trigger up to ASYNC_PF_PER_VCPU * KVM_MAX_VCPUS
async page faults by continuously accessing unmapped pages and intentionally
masking floating interrupts.
This would cause the host's floating interrupt list to hit its maximum
capacity limit, causing kvm_s390_inject_vm() to return -EBUSY and triggering
this WARN_ON_ONCE. Could this be converted to a pr_warn_once() or similar
to avoid host denial of service?
> }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260615124243.187614-1-imbrenda@linux.ibm.com?part=17
prev parent reply other threads:[~2026-06-15 13:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 12:42 [GIT PULL v1 00/17] KVM: s390: New features for 7.2 Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 01/17] KVM: s390: Track page size in struct guest_fault Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 02/17] KVM: s390: Implement KVM_PRE_FAULT_MEMORY Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 03/17] KVM: s390: Update KVM_PRE_FAULT_MEMORY API documentation Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 04/17] KVM: selftests: Fix pre_fault_memory_test to run on s390 Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 05/17] KVM: selftests: Enable pre_fault_memory_test for s390 Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 06/17] KVM: s390: Add module parameter to fence 2G hugepages Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 07/17] KVM: s390: Add capability to support " Claudio Imbrenda
2026-06-15 13:05 ` sashiko-bot
2026-06-15 12:42 ` [GIT PULL v1 08/17] KVM: s390: Allow for " Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 09/17] KVM: s390: Document the KVM_CAP_S390_HPAGE_2G capability Claudio Imbrenda
2026-06-15 13:03 ` sashiko-bot
2026-06-15 12:42 ` [GIT PULL v1 10/17] KVM: s390: Initialize KVM_S390_GET_CMMA_BITS memory Claudio Imbrenda
2026-06-15 13:07 ` sashiko-bot
2026-06-15 12:42 ` [GIT PULL v1 11/17] KVM: s390: Minor refactor of base/ext facility lists Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 12/17] s390/sclp: Detect ASTFLEIE 2 facility Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 13/17] KVM: s390: vsie: Refactor handle_stfle Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 14/17] KVM: s390: vsie: Implement ASTFLEIE facility 2 Claudio Imbrenda
2026-06-15 12:42 ` [GIT PULL v1 15/17] KVM: s390: Add map/unmap ioctl and clean mappings post-guest Claudio Imbrenda
2026-06-15 13:21 ` sashiko-bot
2026-06-15 12:42 ` [GIT PULL v1 16/17] KVM: s390: Enable adapter_indicators_set to use mapped pages Claudio Imbrenda
2026-06-15 13:21 ` sashiko-bot
2026-06-15 12:42 ` [GIT PULL v1 17/17] KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject Claudio Imbrenda
2026-06-15 13:23 ` 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=20260615132301.583DE1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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