lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac9c5912-e19e-4653-9b6c-e68ca3a058f7@lucifer.local>
Date: Wed, 16 Jul 2025 11:50:22 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: David Hildenbrand <david@...hat.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>, akpm@...ux-foundation.org,
        Liam.Howlett@...cle.com, vbabka@...e.cz, peterx@...hat.com,
        jannh@...gle.com, hannes@...xchg.org, mhocko@...nel.org,
        paulmck@...nel.org, shuah@...nel.org, adobriyan@...il.com,
        brauner@...nel.org, josef@...icpanda.com, yebin10@...wei.com,
        linux@...ssschuh.net, willy@...radead.org, osalvador@...e.de,
        andrii@...nel.org, ryan.roberts@....com, christophe.leroy@...roup.eu,
        tjmercier@...gle.com, kaleshsingh@...gle.com, aha310510@...il.com,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-mm@...ck.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v7 1/7] selftests/proc: add /proc/pid/maps tearing from
 vma split test

On Wed, Jul 16, 2025 at 12:44:23PM +0200, David Hildenbrand wrote:
> On 16.07.25 05:05, Suren Baghdasaryan wrote:
> > The /proc/pid/maps file is generated page by page, with the mmap_lock
> > released between pages.  This can lead to inconsistent reads if the
> > underlying vmas are concurrently modified. For instance, if a vma split
> > or merge occurs at a page boundary while /proc/pid/maps is being read,
> > the same vma might be seen twice: once before and once after the change.
> > This duplication is considered acceptable for userspace handling.
> > However, observing a "hole" where a vma should be (e.g., due to a vma
> > being replaced and the space temporarily being empty) is unacceptable.
> >
> > Implement a test that:
> > 1. Forks a child process which continuously modifies its address space,
> > specifically targeting a vma at the boundary between two pages.
> > 2. The parent process repeatedly reads the child's /proc/pid/maps.
> > 3. The parent process checks the last vma of the first page and
> > the first vma of the second page for consistency, looking for the
> > effects of vma splits or merges.
> >
> > The test duration is configurable via the -d command-line parameter
> > in seconds to increase the likelihood of catching the race condition.
> > The default test duration is 5 seconds.
> >
> > Example Command: proc-maps-race -d 10
> >
> > Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
>
> Why is this selftest not making use of any kselftest framework?
>
> I'm sure there is a very good reason :)
>
> Reading assert() feels very weird compared to other selftests.

Sorry to meta-review via your review again David :P

But just to say tools/testing/selftests/kselftest_harness.h is really good, and
makes life simple. See tools/testing/selftests/mm/guard-regions.c for an example
of how they can be used - pretty straightforward and avoids a lot of kselftest
boilerplate.

>
> --
> Cheers,
>
> David / dhildenb
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ