Re: [PATCH 3/4] tools/selftests: expand all guard region tests to file-backed

2025-04-22 Thread Ryan Roberts
On 22/04/2025 12:07, Lorenzo Stoakes wrote: > On Tue, Apr 22, 2025 at 12:03:08PM +0100, Ryan Roberts wrote: >> On 22/04/2025 11:47, Lorenzo Stoakes wrote: >>> On Tue, Apr 22, 2025 at 11:37:57AM +0100, Ryan Roberts wrote: > > [snip] > >>>> >>>>

Re: [PATCH 3/4] tools/selftests: expand all guard region tests to file-backed

2025-04-22 Thread Ryan Roberts
On 22/04/2025 11:47, Lorenzo Stoakes wrote: > On Tue, Apr 22, 2025 at 11:37:57AM +0100, Ryan Roberts wrote: >> On 13/02/2025 18:17, Lorenzo Stoakes wrote: >>> Extend the guard region tests to allow for test fixture variants for anon, >>> shmem, and local file files

Re: [PATCH 3/4] tools/selftests: expand all guard region tests to file-backed

2025-04-22 Thread Ryan Roberts
On 13/02/2025 18:17, Lorenzo Stoakes wrote: > Extend the guard region tests to allow for test fixture variants for anon, > shmem, and local file files. > > This allows us to assert that each of the expected behaviours of anonymous > memory also applies correctly to file-backed (both shmem and an a

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-24 Thread Ryan Roberts
On 23/01/2025 17:40, Peter Xu wrote: > On Thu, Jan 23, 2025 at 02:38:46PM +0000, Ryan Roberts wrote: >>> @@ -5470,7 +5471,18 @@ static void move_huge_pte(struct vm_area_struct >>> *vma, unsigned long old_addr, >>> spin_lock_nested(src_ptl, SINGLE_DEP

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-23 Thread Ryan Roberts
On 23/01/2025 14:38, Ryan Roberts wrote: > I think there might be a bug in this after all... > > > On 07/01/2025 14:47, Ryan Roberts wrote: >> When mremap()ing a memory region previously registered with userfaultfd >> as write-protected but without UFFD_FEATURE_EVENT_RE

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-23 Thread Ryan Roberts
I think there might be a bug in this after all... On 07/01/2025 14:47, Ryan Roberts wrote: > When mremap()ing a memory region previously registered with userfaultfd > as write-protected but without UFFD_FEATURE_EVENT_REMAP, an > inconsistency in flag clearing leads to a mismatch betwee

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-16 Thread Ryan Roberts
On 15/01/2025 20:28, Peter Xu wrote: > On Tue, Jan 07, 2025 at 02:47:52PM +0000, Ryan Roberts wrote: >> When mremap()ing a memory region previously registered with userfaultfd >> as write-protected but without UFFD_FEATURE_EVENT_REMAP, an >> inconsistency in flag clearin

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-15 Thread Ryan Roberts
On 15/01/2025 17:30, Lorenzo Stoakes wrote: > On Wed, Jan 15, 2025 at 12:21:15PM -0500, Peter Xu wrote: >> On Wed, Jan 15, 2025 at 04:58:06PM +0000, Ryan Roberts wrote: >>> Hi Peter, David, >> >> Hey, Ryan, >> >>> >>> On 07/01/2025 14:47, Rya

Re: [PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-15 Thread Ryan Roberts
Hi Peter, David, On 07/01/2025 14:47, Ryan Roberts wrote: > When mremap()ing a memory region previously registered with userfaultfd > as write-protected but without UFFD_FEATURE_EVENT_REMAP, an > inconsistency in flag clearing leads to a mismatch between the vma flags > (which

[PATCH v1 2/2] selftests/mm: Introduce uffd-wp-mremap regression test

2025-01-07 Thread Ryan Roberts
: Ryan Roberts --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 2 + tools/testing/selftests/mm/run_vmtests.sh | 1 + tools/testing/selftests/mm/uffd-wp-mremap.c | 380 4 files changed, 384 insertions(+) create mode

[PATCH v1 1/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-07 Thread Ryan Roberts
existing clearing of VM_UFFD_WP. Be careful to clear the logical flag regardless of its physical form; a PTE bit, a swap PTE bit, or a PTE marker. Cover PTE, huge PMD and hugetlb paths. Co-developed-by: Mikołaj Lenczewski Signed-off-by: Mikołaj Lenczewski Signed-off-by: Ryan Roberts Closes: https

[PATCH v1 0/2] mm: Clear uffd-wp PTE/PMD state on mremap()

2025-01-07 Thread Ryan Roberts
d the patch, which I have subsequently extended. Applies on top of mm-unstable (f349e79bfbf3) Thanks, Ryan Ryan Roberts (2): mm: Clear uffd-wp PTE/PMD state on mremap() selftests/mm: Introduce uffd-wp-mremap regression test include/linux/userfaultfd_k.h | 12 + mm/huge_mem

Re: [PATCH 1/2] selftests/mm: replace atomic_bool with pthread_barrier_t

2024-10-18 Thread Ryan Roberts
On 03/10/2024 22:17, Edward Liaw wrote: > Swaps synchronization primitive with pthread_barrier, so that > stdatomic.h does not need to be included. > > The synchronization is needed on Android ARM64; we see a deadlock with > pthread_create when the parent thread races forward before the child has