From: sashiko-bot@kernel.org
To: "Christian Borntraeger" <borntraeger@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v2] KVM: s390: pv: ignore ultravisor donated storage for kmemleak
Date: Fri, 17 Jul 2026 13:45:10 +0000 [thread overview]
Message-ID: <20260717134510.A8CBB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717133136.5188-1-borntraeger@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Incomplete fix: Kmemleak will crash the host when scanning KVM PV variable storage (stor_var)
--
--- Patch [1]: [PATCH v2] KVM: s390: pv: ignore ultravisor donated storage for kmemleak ---
commit f3ecf0128072e5354e12f9c00c85c0768e09acaa
Author: Christian Borntraeger <borntraeger@linux.ibm.com>
KVM: s390: pv: ignore ultravisor donated storage for kmemleak
This commit fixes host kernel crashes that occur when kmemleak scans the
ultravisor base storage memory. It explicitly tells kmemleak to ignore the
donated memory by calling kmemleak_ignore_phys().
> diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c
> index a284f98d97168..7dde37c365a99 100644
> --- a/arch/s390/kernel/uv.c
> +++ b/arch/s390/kernel/uv.c
[ ... ]
> @@ -70,6 +71,7 @@ void __init setup_uv(void)
> uv_info.uv_base_stor_len);
> goto fail;
> }
> + kmemleak_ignore_phys(__pa(uv_stor_base));
[Severity: High]
This isn't a bug introduced by this patch, but does the same problem apply to
the per-VM variable storage allocated in KVM?
Looking at kvm_s390_pv_alloc_vm(), it allocates stor_var using vzalloc():
arch/s390/kvm/pv.c:kvm_s390_pv_alloc_vm() {
...
kvm->arch.pv.stor_var = vzalloc(vlen);
if (!kvm->arch.pv.stor_var)
goto out_err;
...
}
This memory is tracked by kmemleak and is subsequently donated to the
Ultravisor in kvm_s390_pv_init_vm():
arch/s390/kvm/pv.c:kvm_s390_pv_init_vm() {
...
uvcb.conf_virt_stor_origin = (u64)kvm->arch.pv.stor_var;
...
cc = uv_call_sched(0, (u64)&uvcb);
...
}
Once donated, the underlying physical pages become secure and inaccessible to
the host. Will the kmemleak background thread scanning the vmalloc space attempt
to read this secure memory and trigger a hardware exception, just like it does
for uv_stor_base?
Could a call to kmemleak_ignore(kvm->arch.pv.stor_var) be needed here to make
the fix complete and prevent similar host crashes?
>
> if (uv_init(__pa(uv_stor_base), uv_info.uv_base_stor_len)) {
> memblock_free(uv_stor_base, uv_info.uv_base_stor_len);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260717133136.5188-1-borntraeger@linux.ibm.com?part=1
prev parent reply other threads:[~2026-07-17 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 13:31 [PATCH v2] KVM: s390: pv: ignore ultravisor donated storage for kmemleak Christian Borntraeger
2026-07-17 13:45 ` 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=20260717134510.A8CBB1F000E9@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 \
/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