lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn
Date
This series is the first step towards fixing KVM's usage of follow_pfn.
The immediate fix here is that KVM is not checking the writability of
the PFN, which actually dates back to way before the introduction of
follow_pfn in commit add6a0cd1c5b ("KVM: MMU: try to fix up page faults
before giving up", 2016-07-05). There are more changes needed to
invalidate gfn-to-pfn caches from MMU notifiers, but this issue will
be tackled later.

A more fundamental issue however is that the follow_pfn function is
basically impossible to use correctly. Almost all users for example
are assuming that the page is writable; KVM was not alone in this
mistake. follow_pte, despite not being exported for modules, is a
far saner API. Therefore, patch 1 simplifies follow_pte a bit and
makes it available to modules.

Please review and possibly ack for inclusion in the KVM tree,
thanks!

Paolo


Paolo Bonzini (2):
mm: provide a sane PTE walking API for modules
KVM: do not assume PTE is writable after follow_pfn

arch/s390/pci/pci_mmio.c | 2 +-
fs/dax.c | 5 +++--
include/linux/mm.h | 6 ++++--
mm/memory.c | 35 ++++++++++++++++++++++++++++++-----
virt/kvm/kvm_main.c | 15 ++++++++++++---
5 files changed, 50 insertions(+), 13 deletions(-)

--
2.26.2

\
 
 \ /
  Last update: 2021-02-05 11:47    [W:0.179 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site