Linus Torvalds
f6f3732162
Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths"
...
This reverts commits 5c9d2d5c26 , c7da82b894 , and e7fe7b5cae .
We'll probably need to revisit this, but basically we should not
complicate the get_user_pages_fast() case, and checking the actual page
table protection key bits will require more care anyway, since the
protection keys depend on the exact state of the VM in question.
Particularly when doing a "remote" page lookup (ie in somebody elses VM,
not your own), you need to be much more careful than this was. Dave
Hansen says:
"So, the underlying bug here is that we now a get_user_pages_remote()
and then go ahead and do the p*_access_permitted() checks against the
current PKRU. This was introduced recently with the addition of the
new p??_access_permitted() calls.
We have checks in the VMA path for the "remote" gups and we avoid
consulting PKRU for them. This got missed in the pkeys selftests
because I did a ptrace read, but not a *write*. I also didn't
explicitly test it against something where a COW needed to be done"
It's also not entirely clear that it makes sense to check the protection
key bits at this level at all. But one possible eventual solution is to
make the get_user_pages_fast() case just abort if it sees protection key
bits set, which makes us fall back to the regular get_user_pages() case,
which then has a vma and can do the check there if we want to.
We'll see.
Somewhat related to this all: what we _do_ want to do some day is to
check the PAGE_USER bit - it should obviously always be set for user
pages, but it would be a good check to have back. Because we have no
generic way to test for it, we lost it as part of moving over from the
architecture-specific x86 GUP implementation to the generic one in
commit e585513b76 ("x86/mm/gup: Switch GUP to the generic
get_user_page_fast() implementation").
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-12-15 18:53:22 -08:00
..
kasan
kasan: use %px to print addresses instead of %p
2017-11-29 12:13:16 +11:00
backing-dev.c
bdi: add error handle for bdi_debug_register
2017-11-19 11:02:13 -07:00
balloon_compaction.c
virtio_balloon: fix deadlock on OOM
2017-11-14 23:57:38 +02:00
bootmem.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
cleancache.c
fs: switch ->s_uuid to uuid_t
2017-06-05 16:59:12 +02:00
cma.c
mm/cma.c: change pr_info to pr_err for cma_alloc fail log
2017-11-15 18:21:03 -08:00
cma.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
cma_debug.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
compaction.c
mm, compaction: remove unneeded pageblock_skip_persistent() checks
2017-11-17 16:10:00 -08:00
debug.c
mm: consolidate page table accounting
2017-11-15 18:21:04 -08:00
debug_page_ref.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
dmapool.c
early_ioremap.c
mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
2017-12-11 14:54:44 +01:00
fadvise.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
failslab.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
filemap.c
AFS development
2017-11-16 11:41:22 -08:00
frame_vector.c
mm/frame_vector.c: release a semaphore in 'get_vaddr_frames()'
2017-12-14 16:00:48 -08:00
frontswap.c
gup.c
Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths"
2017-12-15 18:53:22 -08:00
gup_benchmark.c
mm: add infrastructure for get_user_pages_fast() benchmarking
2017-11-17 16:10:04 -08:00
highmem.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
hmm.c
Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths"
2017-12-15 18:53:22 -08:00
huge_memory.c
Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths"
2017-12-15 18:53:22 -08:00
hugetlb.c
mm/hugetlb: fix NULL-pointer dereference on 5-level paging machine
2017-11-29 18:40:43 -08:00
hugetlb_cgroup.c
hwpoison-inject.c
mm: hwpoison: call shake_page() unconditionally
2017-05-03 15:52:12 -07:00
init-mm.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
internal.h
Revert "mm, thp: Do not make pmd/pud dirty without a reason"
2017-11-29 09:01:01 -08:00
interval_tree.c
lib/interval_tree: fast overlap detection
2017-09-08 18:26:49 -07:00
Kconfig
mm: add infrastructure for get_user_pages_fast() benchmarking
2017-11-17 16:10:04 -08:00
Kconfig.debug
kmemcheck: rip it out
2017-11-15 18:21:05 -08:00
khugepaged.c
Revert "mm, thp: Do not make pmd/pud dirty without a reason"
2017-11-29 09:01:01 -08:00
kmemleak-test.c
kmemleak.c
mm/kmemleak.c: make cond_resched() rate-limiting more efficient
2017-12-14 16:00:48 -08:00
ksm.c
mm/mmu_notifier: avoid double notification when it is useless
2017-11-15 18:21:03 -08:00
list_lru.c
mm/list_lru.c: mark expected switch fall-through
2017-11-15 18:21:07 -08:00
maccess.c
madvise.c
mm/madvise.c: fix madvise() infinite loop under special circumstances
2017-11-29 18:40:43 -08:00
Makefile
mm: add infrastructure for get_user_pages_fast() benchmarking
2017-11-17 16:10:04 -08:00
memblock.c
mm: define memblock_virt_alloc_try_nid_raw
2017-11-15 18:21:05 -08:00
memcontrol.c
mm, memcg: fix mem_cgroup_swapout() for THPs
2017-11-29 18:40:43 -08:00
memory-failure.c
mm, soft_offline: improve hugepage soft offlining error log
2017-11-15 18:21:05 -08:00
memory.c
Revert "mm: replace p??_write with pte_access_permitted in fault + gup paths"
2017-12-15 18:53:22 -08:00
memory_hotplug.c
memory hotplug: fix comments when adding section
2017-11-15 18:21:07 -08:00
mempolicy.c
mm, sysctl: make NUMA stats configurable
2017-11-15 18:21:07 -08:00
mempool.c
mm/mempool.c: use kmalloc_array_node()
2017-11-15 18:21:02 -08:00
memtest.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
migrate.c
Revert "mm, thp: Do not make pmd/pud dirty without a reason"
2017-11-29 09:01:01 -08:00
mincore.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
mlock.c
mm: mlock: remove lru_add_drain_all()
2017-11-15 18:21:07 -08:00
mm_init.c
mmap.c
mm, oom_reaper: fix memory corruption
2017-12-14 16:00:49 -08:00
mmu_context.c
mmu_notifier.c
mm/mmu_notifier: avoid call to invalidate_range() in range_end()
2017-11-15 18:21:03 -08:00
mmzone.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
mprotect.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
mremap.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
msync.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
nobootmem.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
nommu.c
Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2017-09-14 18:13:32 -07:00
oom_kill.c
mm, oom_reaper: fix memory corruption
2017-12-14 16:00:49 -08:00
page-writeback.c
Revert "mm/page-writeback.c: print a warning if the vm dirtiness settings are illogical"
2017-11-29 18:40:43 -08:00
page_alloc.c
mm/page_alloc.c: avoid excessive IRQ disabled times in free_unref_page_list()
2017-12-14 16:00:48 -08:00
page_counter.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
page_ext.c
mm/page_ext.c: check if page_ext is not prepared
2017-11-15 18:21:07 -08:00
page_idle.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
page_io.c
mm, swap: skip swapcache for swapin of synchronous device
2017-11-15 18:21:02 -08:00
page_isolation.c
mm: distinguish CMA and MOVABLE isolation in has_unmovable_pages()
2017-11-15 18:21:02 -08:00
page_owner.c
mm/page_owner.c: reduce page_owner structure size
2017-11-15 18:21:03 -08:00
page_poison.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
page_vma_mapped.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
pagewalk.c
mm/pagewalk.c: report holes in hugetlb ranges
2017-11-15 13:12:08 -08:00
percpu-internal.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
percpu-km.c
percpu: replace area map allocator with bitmap
2017-07-26 17:41:05 -04:00
percpu-stats.c
percpu: fix starting offset for chunk statistics traversal
2017-09-27 14:45:57 -07:00
percpu-vm.c
mm: remove __GFP_COLD
2017-11-15 18:21:06 -08:00
percpu.c
percpu: hack to let the CRIS architecture to boot until they clean up
2017-11-27 12:53:12 -08:00
pgtable-generic.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
process_vm_access.c
quicklist.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
readahead.c
rmap.c
mm: remove cold parameter from free_hot_cold_page*
2017-11-15 18:21:06 -08:00
rodata_test.c
mm: fix RODATA_TEST failure "rodata_test: test data was not read only"
2017-10-03 17:54:24 -07:00
shmem.c
Rename superblock flags (MS_xyz -> SB_xyz)
2017-11-27 13:05:09 -08:00
slab.c
mm/slab.c: do not hash pointers when debugging slab
2017-12-14 16:00:48 -08:00
slab.h
kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK
2017-11-15 18:21:04 -08:00
slab_common.c
kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK
2017-11-15 18:21:04 -08:00
slob.c
slab, slub, slob: add slab_flags_t
2017-11-15 18:21:01 -08:00
slub.c
kmemcheck: rip it out
2017-11-15 18:21:05 -08:00
sparse-vmemmap.c
mm, sparse: do not swamp log with huge vmemmap allocation failures
2017-11-15 18:21:07 -08:00
sparse.c
mm: stop zeroing memory during allocation in vmemmap
2017-11-15 18:21:05 -08:00
swap.c
mm, pagevec: rename pagevec drained field
2017-11-15 18:21:06 -08:00
swap_cgroup.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
swap_slots.c
mm/swap_slots.c: fix race conditions in swap_slots cache init
2017-11-15 18:21:03 -08:00
swap_state.c
mm: remove cold parameter for release_pages
2017-11-15 18:21:06 -08:00
swapfile.c
mm: swap: SWP_SYNCHRONOUS_IO: skip swapcache only if swapped page has no other reference
2017-11-15 18:21:02 -08:00
truncate.c
mm, pagevec: remove cold parameter for pagevecs
2017-11-15 18:21:06 -08:00
usercopy.c
userfaultfd.c
userfaultfd: shmem: wire up shmem_mfill_zeropage_pte
2017-09-06 17:27:28 -07:00
util.c
mm: rename global_page_state to global_zone_page_state
2017-09-06 17:27:29 -07:00
vmacache.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
vmalloc.c
Revert "vmalloc: back off when the current task is killed"
2017-10-13 16:18:32 -07:00
vmpressure.c
mm, vmpressure: pass-through notification support
2017-07-10 16:32:31 -07:00
vmscan.c
mm: remove cold parameter from free_hot_cold_page*
2017-11-15 18:21:06 -08:00
vmstat.c
mm, sysctl: make NUMA stats configurable
2017-11-15 18:21:07 -08:00
workingset.c
mm, truncate: do not check mapping for every page being truncated
2017-11-15 18:21:06 -08:00
z3fold.c
mm/z3fold.c: use kref to prevent page free/compact race
2017-11-17 16:10:00 -08:00
zbud.c
zpool.c
zsmalloc.c
zsmalloc: calling zs_map_object() from irq is a bug
2017-11-15 18:21:03 -08:00
zswap.c
mm/zswap.c: delete an error message for a failed memory allocation in zswap_dstmem_prepare()
2017-07-06 16:24:35 -07:00