linux/Documentation/mm
Ruihan Li 08378f0314 mm: page_table_check: Make it dependent on EXCLUSIVE_SYSTEM_RAM
commit 81a31a860b upstream.

Without EXCLUSIVE_SYSTEM_RAM, users are allowed to map arbitrary
physical memory regions into the userspace via /dev/mem. At the same
time, pages may change their properties (e.g., from anonymous pages to
named pages) while they are still being mapped in the userspace, leading
to "corruption" detected by the page table check.

To avoid these false positives, this patch makes PAGE_TABLE_CHECK
depends on EXCLUSIVE_SYSTEM_RAM. This dependency is understandable
because PAGE_TABLE_CHECK is a hardening technique but /dev/mem without
STRICT_DEVMEM (i.e., !EXCLUSIVE_SYSTEM_RAM) is itself a security
problem.

Even with EXCLUSIVE_SYSTEM_RAM, I/O pages may be still allowed to be
mapped via /dev/mem. However, these pages are always considered as named
pages, so they won't break the logic used in the page table check.

Cc: <stable@vger.kernel.org> # 5.17
Signed-off-by: Ruihan Li <lrh2000@pku.edu.cn>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Link: https://lore.kernel.org/r/20230515130958.32471-4-lrh2000@pku.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-06-14 11:15:29 +02:00
..
damon docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
active_mm.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
arch_pgtable_helpers.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
balance.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
bootmem.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
free_page_reporting.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
frontswap.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
highmem.rst Documentation/mm: add details about kmap_local_page() and preemption 2022-08-08 18:06:46 -07:00
hmm.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
hugetlbfs_reserv.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
hwpoison.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
index.rst mm: multi-gen LRU: design doc 2022-09-26 19:46:11 -07:00
ksm.rst ksm: add the ksm prefix to the names of the ksm private structures 2022-10-03 14:02:43 -07:00
memory-model.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
mmu_notifier.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
multigen_lru.rst mm: multi-gen LRU: design doc 2022-09-26 19:46:11 -07:00
numa.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
oom.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
overcommit-accounting.rst - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
page_allocation.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
page_cache.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
page_frags.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
page_migration.rst - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
page_owner.rst A handful of relatively simple documentation fixes, plus a set of patches 2022-10-13 10:58:32 -07:00
page_reclaim.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
page_table_check.rst mm: page_table_check: Make it dependent on EXCLUSIVE_SYSTEM_RAM 2023-06-14 11:15:29 +02:00
page_tables.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
physical_memory.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
process_addrs.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
remap_file_pages.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
shmfs.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
slab.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
slub.rst mm/slub: enable debugging memory wasting of kmalloc 2022-09-23 12:32:45 +02:00
split_page_table_lock.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
swap.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
transhuge.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
unevictable-lru.rst Documentation/mm: modify page_referenced to folio_referenced 2022-09-29 13:16:08 -06:00
vmalloc.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
vmalloced-kernel-stacks.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
vmemmap_dedup.rst mm: hugetlb_vmemmap: move code comments to vmemmap_dedup.rst 2022-08-08 18:06:43 -07:00
z3fold.rst docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
zsmalloc.rst zsmalloc: document freeable stats 2023-04-13 16:55:35 +02:00