Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795542975; b=gCFrWGyTdygl4Uo8PbVBDUY5lpSoTHkojjiByH5WgWr5hKjRo6ErI2sCsivYTbXXPX7e 89n3JvM2xaWlj6sAaNegX+y6fhtKyr+86ZlrkgAVXRmumF1efayx2X/TGfTzNVQoRD35j bFWsoCEiOHa1Nro+bpd4xUehed274RhgwpycWkP7E0xBY5au7jUsJP58br1Ac2BvqzOmU s8f76ZSMn1PFfGEFyBZBboEs93z+lhI6aS+cpo6q3CSGggd8wNj6ZeKRvLFX1tDHiS9oj QE6KZZGclNO4VDilGVXvQRsbVMK7TTawkbFTGTkG+ojWwqRqvwuerAgRm8LnaqktB0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795542975; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=Awn8haymz6+/q/o6Gi3xdMFyqMEbJsi2m01O9ScuRho=; b=ZVAwOZmX3yg0nQC27A1q4C7i+RynYE/0yueJ5GNRchgdJsH7l2dBAyQYNtQza75i70A6 Z4PW4Khv97fIHp24tDmd+EptKroH6wBZ759cFsrY4OKSQsSqmGncg3tF7binIUH85gzAO sUoDMVZrFTg4h7v9K1AQCvQ6G8gSPuzKlozLoaqy/K7eDw6valpi7Yr5/qV9a3oksfwvU DmRYSsib2+7hO9mj2dFZHT8tnqxVoUz+vW6bxXNvUp25wHzbxQ87I5qqqfu36Q5SwjRwT jEnDDys4Mp/R3dvc8HFgFz0lEdnTacZsSSiZBmuB+xSzrzUjnFl62vRugpAdQ25f0uA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=eW3wEbvv; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 709CF606A32A for ; Tue, 24 Nov 2026 17:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=eW3wEbvv Received: by smtp.kernel.org (Postfix) with ESMTPSA id E36021F000C0; Tue, 24 Nov 2026 17:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1795542975; bh=Awn8haymz6+/q/o6Gi3xdMFyqMEbJsi2m01O9ScuRho=; h=Date:To:From:In-Reply-To:References:Subject; b=eW3wEbvvQQahqjRBRYsSKgdPb9x50B/iBt8SPi+7BL574WB59qRGvQsiq6AA0okYa 4xJ8LjFhsscs89Llhsw/k/HsyZuRC/HW6TtO1PxXyK8DrIishmqC8Ll+yFS8AeHESh FKayrbWhrLGjtAeH2n1NDh9RUkQrl+hnyI/k+4TM= Date: Tue, 24 Nov 2026 09:56:14 -0800 To: mm-commits@vger.kernel.org,ljs@kernel.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261124-late-2026-vma-flags-v2-6-bf3fade93064@kernel.org> References: <20261124-late-2026-vma-flags-v2-6-bf3fade93064@kernel.org> Subject: + uprobes-convert-vma-flag-tests-to-use-vma_flags_t.patch added to mm-new branch Message-Id: <20261124175614.E36021F000C0@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: uprobes: convert VMA flag tests to use vma_flags_t has been added to the -mm mm-new branch. Its filename is uprobes-convert-vma-flag-tests-to-use-vma_flags_t.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/uprobes-convert-vma-flag-tests-to-use-vma_flags_t.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: "Lorenzo Stoakes (ARM)" Subject: uprobes: convert VMA flag tests to use vma_flags_t Date: Tue, 24 Nov 2026 17:07:58 +0000 Replace use of the legacy vm_flags_t flags with vma_flags_t values in the uprobes VMA validity checks. No functional change intended. Link: https://patch.msgid.link/20261124-late-2026-vma-flags-v2-6-bf3fade93064@kernel.org Signed-off-by: Lorenzo Stoakes (ARM) Signed-off-by: Andrew Morton Reviewed-by: Lance Yang Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: John Hubbard Cc: Peter Xu Cc: Matthew Wilcox (Oracle) Cc: Jan Kara Cc: Rik van Riel Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Harry Yoo Cc: Jann Horn Cc: Zi Yan Cc: Matthew Brost Cc: Joshua Hahn Cc: Byungchul Park Cc: Gregory Price Cc: Ying Huang Cc: Alistair Popple Cc: Baolin Wang Cc: Nico Pache Cc: Ryan Roberts Cc: Dev Jain Cc: Barry Song Cc: Usama Arif Cc: Kiryl Shutsemau Cc: Xu Xin Cc: Chengming Zhou Cc: Madhavan Srinivasan Cc: Nicholas Piggin Cc: Michael Ellerman Cc: Christophe Leroy Cc: Ritesh Harjani (IBM) Cc: Shrikanth Hegde Cc: Pedro Falcato Cc: Kairui Song Cc: Qi Zheng Cc: Shakeel Butt Cc: Axel Rasmussen Cc: Yuanchu Xie Cc: Wei Xu Cc: Baoquan He Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Leon Romanovsky Cc: SJ Park Cc: Rakie Kim Cc: David Rientjes Cc: Al Viro Cc: Christian Brauner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Namhyung Kim Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Ian Rogers Cc: Adrian Hunter Cc: James Clark Cc: Masami Hiramatsu Cc: Oleg Nesterov Cc: John Johansen Cc: Georgia Garcia Cc: Paul Moore Cc: James Morris Cc: Serge E. Hallyn Cc: Mimi Zohar Cc: Roberto Sassu Cc: Dmitry Kasatkin Cc: Eric Snowberg Cc: Fan Wu Cc: Stephen Smalley Cc: Ondrej Mosnáček kernel/events/uprobes.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/kernel/events/uprobes.c~uprobes-convert-vma-flag-tests-to-use-vma_flags_t +++ a/kernel/events/uprobes.c @@ -134,12 +134,14 @@ static void uprobe_warn(struct task_stru */ static bool valid_vma(struct vm_area_struct *vma, bool is_register) { - vm_flags_t flags = VM_HUGETLB | VM_MAYEXEC | VM_MAYSHARE; + vma_flags_t forbidden = mk_vma_flags(VMA_HUGETLB_BIT, + VMA_MAYSHARE_BIT); if (is_register) - flags |= VM_WRITE; + vma_flags_set(&forbidden, VMA_WRITE_BIT); - return vma->vm_file && (vma->vm_flags & flags) == VM_MAYEXEC; + return vma->vm_file && vma_test(vma, VMA_MAYEXEC_BIT) && + !vma_test_any_mask(vma, forbidden); } static unsigned long offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) @@ -286,7 +288,7 @@ static bool valid_ref_ctr_vma(struct upr return uprobe->ref_ctr_offset && vma->vm_file && file_inode(vma->vm_file) == uprobe->inode && - (vma->vm_flags & (VM_WRITE|VM_SHARED)) == VM_WRITE && + vma_test(vma, VMA_WRITE_BIT) && !vma_test(vma, VMA_SHARED_BIT) && vma->vm_start <= vaddr && vma->vm_end > vaddr; } @@ -1607,7 +1609,7 @@ int uprobe_mmap(struct vm_area_struct *v return 0; if (vma->vm_file && - (vma->vm_flags & (VM_WRITE|VM_SHARED)) == VM_WRITE && + vma_test(vma, VMA_WRITE_BIT) && !vma_test(vma, VMA_SHARED_BIT) && mm_flags_test(MMF_HAS_UPROBES, vma->vm_mm)) delayed_ref_ctr_inc(vma); _ Patches currently in -mm which might be from ljs@kernel.org are mm-msync-return-enomem-if-page-aligned-length-overflows.patch mm-vma-drop-mm-asynchronously-in-vma_start_read.patch mm-vma-predicate-vma_assert_stabilised-on-config_debug_vm.patch mm-only-assert-mmap-locks-if-config_debug_vm-or-lockdep-is-set.patch mm-only-assert-vma-locks-if-config_debug_vm-is-set.patch mm-convert-warn_on_onces-to-vm_warn_on_once-in-vma-lock-code.patch mm-madvise-zap-markers-from-guard-regions.patch mm-mmap-free-gathered-pages-before-mmf_oom_skip.patch percpu-fix-contig-hints-that-are-too-low.patch percpu-search-the-whole-reserved-chunk.patch mm-filemap-convert-fault-and-readahead-logic-to-use-vma_flags_t.patch mm-madvise-convert-madvise_vma_behavior-to-use-vma_flags_t.patch mm-convert-miscellaneous-vma-flag-tests-to-use-vma_flags_t.patch fs-proc-task_mmu-convert-vma-flag-tests-to-use-vma_flags_t.patch fs-coredump-convert-vma_dump_size-to-use-vma_flags_t.patch uprobes-convert-vma-flag-tests-to-use-vma_flags_t.patch perf-convert-vma-flag-tests-to-use-vma_flags_t.patch selinux-convert-vma-flag-tests-to-use-vma_flags_t.patch apparmor-convert-vma-flag-tests-to-use-vma_flags_t.patch ima-convert-vma-flag-tests-to-use-vma_flags_t.patch ipe-convert-vma-flag-tests-to-use-vma_flags_t.patch