Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: Don't re-use inodes when creating guest_memfd files
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. Revert back to having 1 inode per guest_memfd instance by using the "secure" variant of anon_inode_getfile(). Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Sean Christopherson <seanjc@google.com> Fixes: 0f7e60a ("kvm: guestmem: do not use a file system") Signed-off-by: Michael Roth <michael.roth@amd.com> Link: https://lore.kernel.org/r/20231002133230.195738-1-michael.roth@amd.com [sean: add a comment] Signed-off-by: Sean Christopherson <seanjc@google.com>
- Loading branch information