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: <d01a776d-3bcd-43cb-8fc9-b94b5c3d2fa9@lucifer.local>
Date: Fri, 16 Jan 2026 10:33:52 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: David Hildenbrand <david@...nel.org>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
        Shakeel Butt <shakeel.butt@...ux.dev>, Jann Horn <jannh@...gle.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mm: add + use vma_is_stabilised(),
 vma_assert_stabilised() helpers

On Fri, Jan 16, 2026 at 10:27:48AM +0000, Lorenzo Stoakes wrote:
[snip]
> diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
> index cd51e0a43c76..d87a07608295 100644
> --- a/include/linux/mmap_lock.h
> +++ b/include/linux/mmap_lock.h
[snip]
> +/**
> + * vma_assert_stabilised() - assert that this VMA cannot be changed from
> + * underneath us either by having a VMA or mmap lock held.
> + * @vma: The VMA whose stability we wish to assess.
> + *
> + * Note that this will only trigger an assert if CONFIG_DEBUG_VM is set.
> + */
> +static inline void vma_assert_stabilised(struct vm_area_struct *vma)
>  {
> -	return rwsem_is_contended(&mm->mmap_lock);
> +	VM_BUG_ON_VMA(vma_is_stabilised(vma), vma);

OK not had enough coffee this morning :))

Obviously should be !vma_is_stabilised(vma).

Andrew - could you apply the fix-patch below or just fix up my mistake
inline?  Thanks!

Cheers, Lorenzo

>From c95bba4f23981584b105e0e8c1d3ce763cc619e0 Mon Sep 17 00:00:00 2001
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Date: Fri, 16 Jan 2026 10:30:11 +0000
Subject: [PATCH] fix

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
---
 include/linux/mmap_lock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
index d87a07608295..cb18bfa3ae27 100644
--- a/include/linux/mmap_lock.h
+++ b/include/linux/mmap_lock.h
@@ -473,7 +473,7 @@ static inline void mmap_read_unlock_non_owner(struct mm_struct *mm)
  */
 static inline void vma_assert_stabilised(struct vm_area_struct *vma)
 {
-	VM_BUG_ON_VMA(vma_is_stabilised(vma), vma);
+	VM_BUG_ON_VMA(!vma_is_stabilised(vma), vma);
 }

 #endif /* _LINUX_MMAP_LOCK_H */
--
2.52.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ