Re: [PATCH v2] fs: Call kmap_local_page() in copy_string_kernel()

From: Kees Cook
Date: Wed Jul 27 2022 - 17:13:57 EST


On Sun, 24 Jul 2022 23:25:23 +0200, Fabio M. De Francesco wrote:
> The use of kmap_atomic() is being deprecated in favor of kmap_local_page().
>
> With kmap_local_page(), the mappings are per thread, CPU local and not
> globally visible. Furthermore, the mappings can be acquired from any
> context (including interrupts).
>
> Therefore, replace kmap_atomic() with kmap_local_page() in
> copy_string_kernel(). Instead of open-coding local mapping + memcpy(),
> use memcpy_to_page(). Delete a redundant call to flush_dcache_page().
>
> [...]

Applied to for-next/execve, thanks!

[1/1] fs: Call kmap_local_page() in copy_string_kernel()
https://git.kernel.org/kees/c/0ff95c390bc8

--
Kees Cook