From: sashiko-bot@kernel.org
To: "Jaehoon Kim" <jhkim@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH v3] KVM: s390: Fall back to short-term pinning in MAP ioctl
Date: Fri, 24 Jul 2026 13:54:03 +0000 [thread overview]
Message-ID: <20260724135403.937751F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724133943.1664961-1-jhkim@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Guest-triggerable WARN_ON_ONCE in adapter_indicators_set leads to host DoS.
--
--- Patch [1]: [PATCH v3] KVM: s390: Fall back to short-term pinning in MAP ioctl ---
commit 07b3642c0ab06a5f6b361f58b4393eb785c7021c
Author: Jaehoon Kim <jhkim@linux.ibm.com>
KVM: s390: Fall back to short-term pinning in MAP ioctl
This commit modifies the KVM s390 MAP ioctl to support memory types that cannot
be long-term pinned, such as file-backed memory. It falls back to verifying
access with a short-term pin, preserving a map entry with a new pinned flag
set to false. Accesses in the interrupt fast path are updated to skip these
unpinned entries, causing them to fall back to the non-atomic path.
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
[ ... ]
> @@ -2929,8 +2954,11 @@ static struct s390_map_info *get_map_info(struct s390_io_adapter *adapter,
> return NULL;
>
> list_for_each_entry(map, &adapter->maps, list) {
> - if (map->addr == addr)
> + if (map->addr == addr) {
> + if (!map->pinned)
> + return NULL;
[Severity: High]
This isn't a bug introduced by this patch, but returning NULL here forces
the caller to fall back to the non-atomic path in adapter_indicators_set().
If a malicious guest or untrusted userspace configures an IRQ routing entry
with an unmapped host virtual address for summary_addr, the short-term pin
will fail:
arch/s390/kvm/interrupt.c:adapter_indicators_set() {
...
summary_info = get_map_info(adapter, adapter_int->summary_addr);
if (!summary_info) {
...
summary_page = pin_map_page(kvm, adapter_int->summary_addr, 0);
if (WARN_ON_ONCE(!summary_page))
return -1;
...
}
Could this guest-triggerable WARN_ON_ONCE lead to a host denial of service
if panic_on_warn is enabled on the host?
Should this WARN_ON_ONCE be downgraded to a normal error return so that it
safely handles unmapped addresses?
> return map;
> + }
> }
> return NULL;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724133943.1664961-1-jhkim@linux.ibm.com?part=1
prev parent reply other threads:[~2026-07-24 13:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 13:39 [PATCH v3] KVM: s390: Fall back to short-term pinning in MAP ioctl Jaehoon Kim
2026-07-24 13:54 ` 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=20260724135403.937751F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jhkim@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