Re: [PATCH 2/4] powerpc/mm: Handle VDSO unmapping via close() rather than arch_unmap()
From: Jeff Xu <hidden>
Date: 2024-08-08 18:36:56
Also in:
linux-mm, lkml
On Thu, Aug 8, 2024 at 11:08 AM Liam R. Howlett [off-list ref] wrote:
* Jeff Xu [off-list ref] [240807 23:37]:quoted
On Wed, Aug 7, 2024 at 8:21 PM Linus Torvalds [off-list ref] wrote:quoted
On Wed, 7 Aug 2024 at 16:20, Liam R. Howlett [off-list ref] wrote:quoted
Okay, I'm going to try one more time here. You are suggesting to have a conf flag to leave the vdso pointer unchanged when it is unmapped. Having the close behind the conf option will not prevent it from being unmapped or mapped over, so what you are suggesting is have a configuration option that leaves a pointer, mm->context.vdso, to be unsafe if it is unmapped if you disable checkpoint restore.This is a new point that I didn't realize before, if we are going to handle unmap vdso safely, yes, this is a bugfix that should be applied everywhere for all arch, without CHECKPOINT_RESTORE config. Do we need to worry about mmap(fixed) ? which can have the same effect as mremap.Yes, but it should be handled by vm_ops->close() when MAP_FIXED unmaps the vdso. Note that you cannot MAP_FIXED over half of the vma as the vm_ops->may_split() is special_mapping_split(), which just returns -EINVAL.
The may_split() failure logic is specific to vm_special_mapping, right ? Do we still need to keep vm_special_mapping struct , if we are going to treat special vma as normal vma ?
Thanks, Liam