[PATCH v2] arm64: pageattr: Explicitly bail out when changing permissions for vmalloc_huge mappings
Gavin Shan
gshan at redhat.com
Fri Apr 4 02:43:45 PDT 2025
On 4/3/25 3:28 PM, Dev Jain wrote:
> arm64 uses apply_to_page_range to change permissions for kernel vmalloc mappings,
> which does not support changing permissions for block mappings. This function
> will change permissions until it encounters a block mapping, and will bail
> out with a warning. Since there are no reports of this triggering, it
> implies that there are currently no cases of code doing a vmalloc_huge()
> followed by partial permission change. But this is a footgun waiting to
> go off, so let's detect it early and avoid the possibility of permissions
> in an intermediate state. So, explicitly disallow changing permissions
> for VM_ALLOW_HUGE_VMAP mappings.
>
> Reviewed-by: Ryan Roberts <ryan.roberts at arm.com>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> Signed-off-by: Dev Jain <dev.jain at arm.com>
> ---
> v1->v2:
> - Improve changelog, keep mention of page mappings in comment
>
> arch/arm64/mm/pageattr.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
Reviewed-by: Gavin Shan <gshan at redhat.com>
More information about the linux-arm-kernel
mailing list