]> www.infradead.org Git - users/jedix/linux-maple.git/commit
execmem: don't remove ROX cache from the direct map
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 26 Jan 2025 07:47:28 +0000 (09:47 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 3 Feb 2025 10:46:01 +0000 (11:46 +0100)
commit925f426451182a9f3e0f7f0e7e928f32f81a966a
tree2af5cdc0f27188466f44ca43638acd5ba69efea8
parent41d88484c71cd4f659348da41b7b5b3dbd3be1f6
execmem: don't remove ROX cache from the direct map

The memory allocated for the ROX cache was removed from the direct map to
reduce amount of direct map updates, however this cannot be tolerated by
/proc/kcore that accesses module memory using vread_iter() and the latter
does vmalloc_to_page() and copy_page_to_iter_nofault().

Instead of removing ROX cache memory from the direct map and mapping it as
ROX in vmalloc space, simply call set_memory_rox() that will take care of
proper permissions on both vmalloc and in the direct map.

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-5-rppt@kernel.org
mm/execmem.c