KVM: do not assume PTE is writable after follow_pfn
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 12 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm: provide a sane PTE walking API for modulesarch/ fs/ include/ +1 more | +39 | 5 replies | |
| 2/2 | KVM: do not assume PTE is writable after follow_pfnvirt/ | +12 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jason Gunthorpe | Peter Xu |
|---|---|---|
| Series | R-b | |
| 1/2 | R-b | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] KVM: do not assume PTE is writable after follow_pfn
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(-)
Signature · 1 line
2.26.2