]> www.infradead.org Git - users/jedix/linux-maple.git/commit
execmem: add API for temporal remapping as RW and restoring ROX afterwards
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 26 Jan 2025 07:47:29 +0000 (09:47 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 3 Feb 2025 10:46:02 +0000 (11:46 +0100)
commit05e555b817262b5df6aa3a73df8b3dc9d388a3b4
treed5b3dd4fa9ce56645cd2180edefa5607d6e59202
parent925f426451182a9f3e0f7f0e7e928f32f81a966a
execmem: add API for temporal remapping as RW and restoring ROX afterwards

Using a writable copy for ROX memory is cumbersome and error prone.

Add API that allow temporarily remapping of ranges in the ROX cache as
writable  and then restoring their read-only-execute permissions.

This API will be later used in modules code and will allow removing nasty
games with writable copy in alternatives patching on x86.

The restoring of the ROX permissions relies on the ability of architecture
to reconstruct large pages in its set_memory_rox() method.

Signed-off-by: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250126074733.1384926-6-rppt@kernel.org
include/linux/execmem.h
mm/execmem.c