From: sashiko-bot@kernel.org
To: "Ackerley Tng via B4 Relay" <devnull+ackerleytng.google.com@kernel.org>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] KVM: guest_memfd: Fix possible signed integer overflow
Date: Fri, 22 May 2026 21:54:42 +0000 [thread overview]
Message-ID: <20260522215442.F0E711F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260522-fix-sev-gmem-post-populate-v1-2-9fc8d6437b65@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The fallback stub definition of `kvm_gmem_bind()` for `!CONFIG_KVM_GUEST_MEMFD` was not updated to reflect the new `u64 offset` parameter type.
--
commit d25bb3b9adbe143acc8b3b7339c4bf637a62df32
Author: Sean Christopherson <seanjc@google.com>
KVM: guest_memfd: Fix possible signed integer overflow
This commit changes the type of the offset parameter in kvm_gmem_bind() from
loff_t to u64 to prevent potential signed integer overflow issues when passing
large 64-bit offsets. It also updates the local size variable to size_t.
> diff --git a/virt/kvm/kvm_mm.h b/virt/kvm/kvm_mm.h
> index 9fcc5d5b7f8d0..23813d74ce709 100644
> --- a/virt/kvm/kvm_mm.h
> +++ b/virt/kvm/kvm_mm.h
> @@ -72,7 +72,7 @@ int kvm_gmem_init(struct module *module);
> void kvm_gmem_exit(void);
> int kvm_gmem_create(struct kvm *kvm, struct kvm_create_guest_memfd *args);
> int kvm_gmem_bind(struct kvm *kvm, struct kvm_memory_slot *slot,
> - unsigned int fd, loff_t offset);
> + unsigned int fd, u64 offset);
> void kvm_gmem_unbind(struct kvm_memory_slot *slot);
> #else
> static inline int kvm_gmem_init(struct module *module)
[Severity: Low]
Does the fallback stub definition of kvm_gmem_bind() for !CONFIG_KVM_GUEST_MEMFD
also need to be updated to match this new signature?
It looks like the static inline stub in the #else block might still be expecting
loff_t offset, which could cause an inconsistent API signature and potentially
trigger compiler warnings.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260522-fix-sev-gmem-post-populate-v1-0-9fc8d6437b65@google.com?part=2
next prev parent reply other threads:[~2026-05-22 21:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 20:45 [PATCH 0/3] guest_memfd fixes for bind and populate Ackerley Tng via B4 Relay
2026-05-22 20:45 ` Ackerley Tng
2026-05-22 20:45 ` [PATCH 1/3] KVM: guest_memfd: Use write permissions when GUP-ing source pages Ackerley Tng via B4 Relay
2026-05-22 20:45 ` Ackerley Tng
2026-05-22 21:19 ` sashiko-bot
2026-05-22 20:45 ` [PATCH 2/3] KVM: guest_memfd: Fix possible signed integer overflow Ackerley Tng via B4 Relay
2026-05-22 20:45 ` Ackerley Tng
2026-05-22 21:54 ` sashiko-bot [this message]
2026-05-22 22:40 ` Sean Christopherson
2026-05-22 20:45 ` [PATCH 3/3] KVM: guest_memfd: Handle errors from xa_store_range() when binding Ackerley Tng via B4 Relay
2026-05-22 20:45 ` Ackerley Tng
2026-05-22 22:21 ` sashiko-bot
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=20260522215442.F0E711F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=devnull+ackerleytng.google.com@kernel.org \
--cc=kvm@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 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.