Skip to content

RFC arm64: mm: Map fixmap page tables read-only

Ard Biesheuvel linux-arm-kernel linux-hardening lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest4 patches 5 repliesIn review
  2. v1 RFC1 patch 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4arm64: mm: Map fixmap PTE tables r/o in the linear maparch/arm64/include/asm/fixmap.h arch/arm64/mm/fixmap.c arch/arm64/mm/mmu.c+16 -31 reply
2/4arm64: mm: Use fault handler to permit swapper_pg_dir updatesarch/arm64/include/asm/fixmap.h arch/arm64/include/asm/pgtable.h arch/arm64/mm/mmu.c+32 -361 reply
3/4arm64: mm: Create r/o page table region that permits updatesarch/arm64/include/asm/pgtable.h arch/arm64/kernel/vmlinux.lds.S arch/arm64/mm/mmu.c+29 -90 replies
4/4arm64: mm: Move fixmap intermediate page tables into .rodataarch/arm64/include/asm/linkage.h arch/arm64/mm/fixmap.c+3 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/4] arm64: mm: Map fixmap page tables read-only

From: Ard Biesheuvel <[email protected]>

This v2 now covers intermediate level page tables as well as the PTE level page table for the fixmap. The latter is a special case, as it

a) is only accessed via the kernel image's mapping, and never via the linear map (except for ptdump etc)

b) must be accessible via a read-write mapping, as all manipulation of read-only page table descriptors relies on the fixmap itself

and so it is treated separately. The intermediate page tables may be shared with other mappings in the upper kernel/vmalloc region, so they must be updatable using the ordinary APIs.

Build tested and boot tested on a Lenovo Yoga C630 using 16k pages.

v1: https://lore.kernel.org/all/[email protected]/

Cc Ryan Roberts <[email protected]>
Cc Anshuman Khandual <[email protected]>
Cc Kevin Brodsky <[email protected]>
Cc Liz Prucka <[email protected]>
Cc Seth Jenkins <[email protected]>
Cc Kees Cook <[email protected]>
Cc Jann Horn <[email protected]>

Ard Biesheuvel (4):
arm64: mm: Map fixmap PTE tables r/o in the linear map
arm64: mm: Use fault handler to permit swapper_pg_dir updates
arm64: mm: Create r/o page table region that permits updates
arm64: mm: Move fixmap intermediate page tables into .rodata

 arch/arm64/include/asm/fixmap.h  |  4 ++
 arch/arm64/include/asm/linkage.h |  1 +
 arch/arm64/include/asm/pgtable.h | 55 ++++++++------------
 arch/arm64/kernel/vmlinux.lds.S  |  6 +++
 arch/arm64/mm/fixmap.c           | 12 +++--
 arch/arm64/mm/mmu.c              | 48 +++++++++++++----
 6 files changed, 78 insertions(+), 48 deletions(-)
Signature · 1 line
2.55.0.887.g758fc8c411-goog