Re: [PATCH gmem FIXUP] KVM: Don't re-use inodes when creating guest_memfd files

From: Sean Christopherson
Date: Thu Oct 05 2023 - 22:21:59 EST


On Mon, 02 Oct 2023 08:32:30 -0500, Michael Roth wrote:
> anon_inode_getfile() uses a singleton inode, which results in the inode
> size changing based with each new KVM_CREATE_GUEST_MEMFD call, which
> can later lead to previously-created guest_memfd files failing bounds
> checks that are later performed when memslots are bound to them. More
> generally, the inode may be associated with other state that cannot be
> shared across multiple guest_memfd instances.
>
> [...]

Applied to kvm-x86 guest_memfd, thanks! I added a comment to explain the use
of the "secure" API, there's a non-zero chance we'll forget that wrinkle again
in the future.

[1/1] KVM: Don't re-use inodes when creating guest_memfd files
https://github.com/kvm-x86/linux/commit/b3bf68b66062

--
https://github.com/kvm-x86/linux/tree/next