Re: [PATCH] selftests/prctl: Fix non-anonymous VMA mapping in set-anon-vma-name test

Hongfu Li <[email protected]> Tue, 4 Aug 2026 19:12:18 +0800
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
> AI review found one glitch which I don't think we need to care about:
> 	https://sashiko.dev/#/patchset/[email protected]
> 
> and one possible pre-existing issue which is kinda related and which
> you may choose to address.  Please take a look and let us know?

Thanks for the review. I've carefully considered the AI review's findings.

The /dev/zero case raised by the AI reviewer may be addressed by commit
cc3b846182db ("mm/vma: make MAP_PRIVATE-mapped /dev/zero mappings truly
anonymous"), which makes these mappings truly anonymous (no vm_file, no
vm_ops). So the vma->vm_file checks in madvise.c should not wrongly
reject them.

That said, I agree that vma_is_anonymous(vma) better expresses the intent
than vma->vm_file in these sites. I'm happy to send a separate patch for
that if needed.

Best regards,
Hongfu