| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/23 13:13 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [
"do_mlock",
"apply_mlockall_flags",
"sys_mlockall",
"sys_mlock2"
],
"Reasoning": "The patch modifies the behavior of mlock2 and mlockall syscalls when the MLOCK_ONFAULT (or MCL_ONFAULT) flag is specified, preventing the immediate population of memory pages. This is a functional change in the core memory management subsystem that is reachable from user space.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/23 13:13 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 359a473cc04b66fe0bccab94badd60582226dda5\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Jul 23 13:13:32 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/mm/mlock.c b/mm/mlock.c\nindex efa6716e4dfbdf..784bd4bfc3bb64 100644\n--- a/mm/mlock.c\n+++ b/mm/mlock.c\n@@ -658,9 +658,11 @@ static __must_check int do_mlock(unsigned long start, size_t len,\n \tif (error)\n \t\treturn error;\n \n-\terror = __mm_populate(start, len, 0);\n-\tif (error)\n-\t\treturn __mlock_posix_error_return(error);\n+\tif (!vma_flags_test(flags, VMA_LOCKONFAULT_BIT)) {\n+\t\terror = __mm_populate(start, len, 0);\n+\t\tif (error)\n+\t\t\treturn __mlock_posix_error_return(error);\n+\t}\n \treturn 0;\n }\n \n@@ -778,7 +780,7 @@ SYSCALL_DEFINE1(mlockall, int, flags)\n \t capable(CAP_IPC_LOCK))\n \t\tret = apply_mlockall_flags(flags);\n \tmmap_write_unlock(current-\u003emm);\n-\tif (!ret \u0026\u0026 (flags \u0026 MCL_CURRENT))\n+\tif (!ret \u0026\u0026 (flags \u0026 MCL_CURRENT) \u0026\u0026 !(flags \u0026 MCL_ONFAULT))\n \t\tmm_populate(0, TASK_SIZE);\n \n \treturn ret;\n"
} |
| 2/1 | 2026/07/23 13:13 | agent | patch-evaluator |
1mModel:best-expensive Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [
"do_mlock",
"apply_mlockall_flags",
"sys_mlockall",
"sys_mlock2"
],
"Reasoning": "The patch modifies the behavior of mlock2 and mlockall syscalls when the MLOCK_ONFAULT (or MCL_ONFAULT) flag is specified, preventing the immediate population of memory pages. This is a functional change in the core memory management subsystem that is reachable from user space.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 359a473cc04b66fe0bccab94badd60582226dda5
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Jul 23 13:13:32 2026 +0000
syz-cluster: applied patch under review
diff --git a/mm/mlock.c b/mm/mlock.c
index efa6716e4dfbdf..784bd4bfc3bb64 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -658,9 +658,11 @@ static __must_check int do_mlock(unsigned long start, size_t len,
if (error)
return error;
- error = __mm_populate(start, len, 0);
- if (error)
- return __mlock_posix_error_return(error);
+ if (!vma_flags_test(flags, VMA_LOCKONFAULT_BIT)) {
+ error = __mm_populate(start, len, 0);
+ if (error)
+ return __mlock_posix_error_return(error);
+ }
return 0;
}
@@ -778,7 +780,7 @@ SYSCALL_DEFINE1(mlockall, int, flags)
capable(CAP_IPC_LOCK))
ret = apply_mlockall_flags(flags);
mmap_write_unlock(current->mm);
- if (!ret && (flags & MCL_CURRENT))
+ if (!ret && (flags & MCL_CURRENT) && !(flags & MCL_ONFAULT))
mm_populate(0, TASK_SIZE);
return ret;
|
| 3/2 | 2026/07/23 13:13 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 2054 output: 30 thoughts: 330 Thoughts: **Analyzing the mlock Patch** Okay, so I'm looking at this patch for `mm/mlock.c`. It's pretty straightforward, modifying the behavior of `do_mlock` and `sys_mlockall`. The key change is this conditional: we're skipping the call to `__mm_populate` when a specific flag is set. Ah, it's about the `VMA_LOCKONFAULT_BIT`. That's intriguing. In `do_mlock`, we check `vma_flags_test(flags, VMA_LOCKONFAULT_BIT)`. This seems to be the trigger to defer page population. The original code in `do_mlock` directly calls `__mm_populate`, which forces the pages to be mapped into memory immediately. This patch introduces a "lazy" approach where we don't do that if `VMA_LOCKONFAULT_BIT` is set. Okay, that makes sense - deferring page population to the point where the memory is actually accessed. This likely improves performance in specific scenarios where the locked region might not be fully used or immediately required. Now, in `sys_mlockall`, it's similar: `MCL_ONFAULT` is added to a condition that avoids `mm_populate`. This is interesting; it aligns perfectly with the change in `do_mlock`. So `MCL_ONFAULT` and `VMA_LOCKONFAULT_BIT` must be related. Wait a second… I need to confirm: are `flags` in `do_mlock` of type `vm_flags_t` or `mlock_flags`? I need to quickly refresh my memory of the structure declarations and the parameter passing. I should double check the `do_mlock` function declaration in `mm/mlock.c` to confirm. Otherwise, I would have made a massive assumption here. |
| 4/2 | 2026/07/23 13:13 | tool | grepper |
0mArgs:{
"Expression": "do_mlock",
"PathPrefix": "mm/mlock.c"
}Results: {
"Output": "mm/mlock.c=36=static DEFINE_PER_CPU(struct mlock_fbatch, mlock_fbatch) = {\n--\nmm/mlock.c-39-\nmm/mlock.c:40:bool can_do_mlock(void)\nmm/mlock.c-41-{\n--\nmm/mlock.c-47-}\nmm/mlock.c:48:EXPORT_SYMBOL(can_do_mlock);\nmm/mlock.c-49-\n--\nmm/mlock.c=610=static int __mlock_posix_error_return(long retval)\n--\nmm/mlock.c-618-\nmm/mlock.c:619:static __must_check int do_mlock(unsigned long start, size_t len,\nmm/mlock.c-620-\t\t\t\t vma_flags_t *flags)\n--\nmm/mlock.c-627-\nmm/mlock.c:628:\tif (!can_do_mlock())\nmm/mlock.c-629-\t\treturn -EPERM;\n--\nmm/mlock.c=669=SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)\n--\nmm/mlock.c-672-\nmm/mlock.c:673:\treturn do_mlock(start, len, \u0026flags);\nmm/mlock.c-674-}\n--\nmm/mlock.c=676=SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)\n--\nmm/mlock.c-685-\nmm/mlock.c:686:\treturn do_mlock(start, len, \u0026vma_flags);\nmm/mlock.c-687-}\n--\nmm/mlock.c=760=SYSCALL_DEFINE1(mlockall, int, flags)\n--\nmm/mlock.c-768-\nmm/mlock.c:769:\tif (!can_do_mlock())\nmm/mlock.c-770-\t\treturn -EPERM;\n"
} |
| 5/2 | 2026/07/23 13:13 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 3375 output: 34 thoughts: 77 Thoughts: Okay, let's break this down. **Analyzing the Memory Locking Patch** Right, so this patch is targeting memory locking, specifically the `do_mlock` function and the `sys_mlockall` system call. The architecture seems pretty straightforward. `do_mlock` is the workhorse, called by the user-space entry points `sys_mlock` and `sys_mlock2`. `sys_mlockall` is the all-encompassing version, and it's called by the standard `mlockall` function. It seems that the key area to analyze for the patch's effects is `do_mlock`. Time to dig into the code. I'll need to check the implementation of `do_mlock` in `mm/mlock.c`. That should show me where the changes were made and how they're intended to work. |
| 6/2 | 2026/07/23 13:13 | tool | read-file |
0mArgs:{
"File": "mm/mlock.c",
"FirstLine": 619,
"LineCount": 50
}Results: {
"Contents": " 619:\tstatic __must_check int do_mlock(unsigned long start, size_t len,\n 620:\t\t\t\t\t vma_flags_t *flags)\n 621:\t{\n 622:\t\tunsigned long locked;\n 623:\t\tunsigned long lock_limit;\n 624:\t\tint error = -ENOMEM;\n 625:\t\n 626:\t\tstart = untagged_addr(start);\n 627:\t\n 628:\t\tif (!can_do_mlock())\n 629:\t\t\treturn -EPERM;\n 630:\t\n 631:\t\tlen = PAGE_ALIGN(len + (offset_in_page(start)));\n 632:\t\tstart \u0026= PAGE_MASK;\n 633:\t\n 634:\t\tlock_limit = rlimit(RLIMIT_MEMLOCK);\n 635:\t\tlock_limit \u003e\u003e= PAGE_SHIFT;\n 636:\t\tlocked = len \u003e\u003e PAGE_SHIFT;\n 637:\t\n 638:\t\tif (mmap_write_lock_killable(current-\u003emm))\n 639:\t\t\treturn -EINTR;\n 640:\t\n 641:\t\tlocked += current-\u003emm-\u003elocked_vm;\n 642:\t\tif ((locked \u003e lock_limit) \u0026\u0026 (!capable(CAP_IPC_LOCK))) {\n 643:\t\t\t/*\n 644:\t\t\t * It is possible that the regions requested intersect with\n 645:\t\t\t * previously mlocked areas, that part area in \"mm-\u003elocked_vm\"\n 646:\t\t\t * should not be counted to new mlock increment count. So check\n 647:\t\t\t * and adjust locked count if necessary.\n 648:\t\t\t */\n 649:\t\t\tlocked -= count_mm_mlocked_page_nr(current-\u003emm,\n 650:\t\t\t\t\tstart, len);\n 651:\t\t}\n 652:\t\n 653:\t\t/* check against resource limits */\n 654:\t\tif ((locked \u003c= lock_limit) || capable(CAP_IPC_LOCK))\n 655:\t\t\terror = apply_vma_lock_flags(start, len, flags);\n 656:\t\n 657:\t\tmmap_write_unlock(current-\u003emm);\n 658:\t\tif (error)\n 659:\t\t\treturn error;\n 660:\t\n 661:\t\tif (!vma_flags_test(flags, VMA_LOCKONFAULT_BIT)) {\n 662:\t\t\terror = __mm_populate(start, len, 0);\n 663:\t\t\tif (error)\n 664:\t\t\t\treturn __mlock_posix_error_return(error);\n 665:\t\t}\n 666:\t\treturn 0;\n 667:\t}\n 668:\t\n"
} |
| 7/2 | 2026/07/23 13:13 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 4403 output: 26 thoughts: 105 Thoughts: **Analyzing the VMA_LOCKONFAULT_BIT Check** Okay, so this patch is aimed at stopping `__mm_populate` from being called under certain conditions. The key trigger is the `VMA_LOCKONFAULT_BIT` flag. Right, but hang on a second... `flags`. That's a pointer to a `vma_flags_t` struct, isn't it? Let me just make sure I have that straight... Yes, confirmed, pointer. Now, how's the check implemented? Ah, it's using `vma_flags_test()`. But... doesn't that function take a pointer? Let me just double-check that quick. Gotta be absolutely sure we're handling the pointer correctly here and not dereferencing something we shouldn't. Yep, good. |
| 8/2 | 2026/07/23 13:13 | tool | grepper |
0mArgs:{
"Expression": "vma_flags_test",
"PathPrefix": ""
}Results: {
"Output": "\nFull output is too long, showing 500 out of 544 lines.\nUse more precise expression if possible.\n\ndrivers/dax/device.c=16=static int __check_vma(struct dev_dax *dev_dax, vma_flags_t flags,\n--\ndrivers/dax/device.c-26-\t/* prevent private mappings from being established */\ndrivers/dax/device.c:27:\tif (!vma_flags_test_any(\u0026flags, VMA_MAYSHARE_BIT)) {\ndrivers/dax/device.c-28-\t\tdev_info_ratelimited(dev,\n--\ninclude/linux/hugetlb_inline.h=9=static inline bool is_vma_hugetlb_flags(const vma_flags_t *flags)\ninclude/linux/hugetlb_inline.h-10-{\ninclude/linux/hugetlb_inline.h:11:\treturn vma_flags_test(flags, VMA_HUGETLB_BIT);\ninclude/linux/hugetlb_inline.h-12-}\n--\ninclude/linux/mm.h=1162=static __always_inline int vma_flags_count(const vma_flags_t *flags)\n--\ninclude/linux/mm.h-1171- *\ninclude/linux/mm.h:1172: * if (vma_flags_test(flags, VMA_READ_BIT)) { ... }\ninclude/linux/mm.h-1173- */\ninclude/linux/mm.h:1174:static __always_inline bool vma_flags_test(const vma_flags_t *flags,\ninclude/linux/mm.h-1175-\t\tvma_flag_t bit)\n--\ninclude/linux/mm.h=1186=static __always_inline vma_flags_t vma_flags_and_mask(const vma_flags_t *flags,\n--\ninclude/linux/mm.h-1208-/* Test each of to_test flags in flags, non-atomically. */\ninclude/linux/mm.h:1209:static __always_inline bool vma_flags_test_any_mask(const vma_flags_t *flags,\ninclude/linux/mm.h-1210-\t\tvma_flags_t to_test)\n--\ninclude/linux/mm.h-1220- *\ninclude/linux/mm.h:1221: * if (vma_flags_test_any(flags, VMA_READ_BIT, VMA_MAYREAD_BIT)) { ... }\ninclude/linux/mm.h-1222- */\ninclude/linux/mm.h:1223:#define vma_flags_test_any(flags, ...) \\\ninclude/linux/mm.h:1224:\tvma_flags_test_any_mask(flags, mk_vma_flags(__VA_ARGS__))\ninclude/linux/mm.h-1225-\ninclude/linux/mm.h-1226-/* Test that ALL of the to_test flags are set, non-atomically. */\ninclude/linux/mm.h:1227:static __always_inline bool vma_flags_test_all_mask(const vma_flags_t *flags,\ninclude/linux/mm.h-1228-\t\tvma_flags_t to_test)\n--\ninclude/linux/mm.h-1238- *\ninclude/linux/mm.h:1239: * if (vma_flags_test_all(flags, VMA_READ_BIT, VMA_MAYREAD_BIT)) { ... }\ninclude/linux/mm.h-1240- */\ninclude/linux/mm.h:1241:#define vma_flags_test_all(flags, ...) \\\ninclude/linux/mm.h:1242:\tvma_flags_test_all_mask(flags, mk_vma_flags(__VA_ARGS__))\ninclude/linux/mm.h-1243-\n--\ninclude/linux/mm.h-1250- *\ninclude/linux/mm.h:1251: * if (vma_flags_test_single_mask(\u0026flags, VMA_DROPPABLE)) { ... }\ninclude/linux/mm.h-1252- *\n--\ninclude/linux/mm.h-1255- */\ninclude/linux/mm.h:1256:static __always_inline bool vma_flags_test_single_mask(const vma_flags_t *flags,\ninclude/linux/mm.h-1257-\t\tvma_flags_t flagmask)\n--\ninclude/linux/mm.h-1260-\ninclude/linux/mm.h:1261:\treturn vma_flags_test_any_mask(flags, flagmask);\ninclude/linux/mm.h-1262-}\n--\ninclude/linux/mm.h=1373=static __always_inline bool vma_test(const struct vm_area_struct *vma,\n--\ninclude/linux/mm.h-1375-{\ninclude/linux/mm.h:1376:\treturn vma_flags_test(\u0026vma-\u003eflags, bit);\ninclude/linux/mm.h-1377-}\n--\ninclude/linux/mm.h=1380=static __always_inline bool vma_test_any_mask(const struct vm_area_struct *vma,\n--\ninclude/linux/mm.h-1382-{\ninclude/linux/mm.h:1383:\treturn vma_flags_test_any_mask(\u0026vma-\u003eflags, flags);\ninclude/linux/mm.h-1384-}\n--\ninclude/linux/mm.h=1402=static __always_inline bool vma_test_all_mask(const struct vm_area_struct *vma,\n--\ninclude/linux/mm.h-1404-{\ninclude/linux/mm.h:1405:\treturn vma_flags_test_all_mask(\u0026vma-\u003eflags, flags);\ninclude/linux/mm.h-1406-}\n--\ninclude/linux/mm.h=1429=vma_test_single_mask(const struct vm_area_struct *vma, vma_flags_t flagmask)\ninclude/linux/mm.h-1430-{\ninclude/linux/mm.h:1431:\treturn vma_flags_test_single_mask(\u0026vma-\u003eflags, flagmask);\ninclude/linux/mm.h-1432-}\n--\ninclude/linux/mm.h=1479=static __always_inline bool vma_desc_test(const struct vm_area_desc *desc,\n--\ninclude/linux/mm.h-1481-{\ninclude/linux/mm.h:1482:\treturn vma_flags_test(\u0026desc-\u003evma_flags, bit);\ninclude/linux/mm.h-1483-}\n--\ninclude/linux/mm.h=1486=static __always_inline bool vma_desc_test_any_mask(const struct vm_area_desc *desc,\n--\ninclude/linux/mm.h-1488-{\ninclude/linux/mm.h:1489:\treturn vma_flags_test_any_mask(\u0026desc-\u003evma_flags, flags);\ninclude/linux/mm.h-1490-}\n--\ninclude/linux/mm.h=1503=static __always_inline bool vma_desc_test_all_mask(const struct vm_area_desc *desc,\n--\ninclude/linux/mm.h-1505-{\ninclude/linux/mm.h:1506:\treturn vma_flags_test_all_mask(\u0026desc-\u003evma_flags, flags);\ninclude/linux/mm.h-1507-}\n--\ninclude/linux/mm.h=1587=static inline bool vma_flags_can_grow(const vma_flags_t *flags)\ninclude/linux/mm.h-1588-{\ninclude/linux/mm.h:1589:\tif (vma_flags_test_single_mask(flags, VMA_GROWSUP))\ninclude/linux/mm.h-1590-\t\treturn true;\ninclude/linux/mm.h:1591:\tif (vma_flags_test(flags, VMA_GROWSDOWN_BIT))\ninclude/linux/mm.h-1592-\t\treturn true;\n--\ninclude/linux/mm.h=1630=static inline bool is_shared_maywrite(const vma_flags_t *flags)\ninclude/linux/mm.h-1631-{\ninclude/linux/mm.h:1632:\treturn vma_flags_test_all(flags, VMA_SHARED_BIT, VMA_MAYWRITE_BIT);\ninclude/linux/mm.h-1633-}\n--\ninclude/linux/mm.h=2277=static inline bool vma_desc_is_cow_mapping(struct vm_area_desc *desc)\n--\ninclude/linux/mm.h-2280-\ninclude/linux/mm.h:2281:\treturn vma_flags_test(flags, VMA_MAYWRITE_BIT) \u0026\u0026\ninclude/linux/mm.h:2282:\t\t!vma_flags_test(flags, VMA_SHARED_BIT);\ninclude/linux/mm.h-2283-}\n--\ninclude/linux/mm.h=2299=static inline bool is_nommu_shared_vma_flags(const vma_flags_t *flags)\ninclude/linux/mm.h-2300-{\ninclude/linux/mm.h:2301:\treturn vma_flags_test_any(flags, VMA_MAYSHARE_BIT, VMA_MAYOVERLAY_BIT);\ninclude/linux/mm.h-2302-}\n--\nmm/hugetlb.c=6677=long hugetlb_reserve_pages(struct inode *inode,\n--\nmm/hugetlb.c-6706-\t */\nmm/hugetlb.c:6707:\tif (vma_flags_test(\u0026vma_flags, VMA_NORESERVE_BIT))\nmm/hugetlb.c-6708-\t\treturn 0;\n--\nmm/ksm.c=744=static bool ksm_compatible(const struct file *file, vma_flags_t vma_flags)\n--\nmm/ksm.c-746-\t/* Just ignore the advice. */\nmm/ksm.c:747:\tif (vma_flags_test_any(\u0026vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT,\nmm/ksm.c-748-\t\t\t VMA_HUGETLB_BIT))\nmm/ksm.c-749-\t\treturn false;\nmm/ksm.c:750:\tif (vma_flags_test_single_mask(\u0026vma_flags, VMA_DROPPABLE))\nmm/ksm.c-751-\t\treturn false;\nmm/ksm.c:752:\tif (vma_flags_test_any_mask(\u0026vma_flags, VMA_SPECIAL_FLAGS))\nmm/ksm.c-753-\t\treturn false;\n--\nmm/ksm.c-756-#ifdef VM_SAO\nmm/ksm.c:757:\tif (vma_flags_test(\u0026vma_flags, VMA_SAO_BIT))\nmm/ksm.c-758-\t\treturn false;\n--\nmm/ksm.c-760-#ifdef VM_SPARC_ADI\nmm/ksm.c:761:\tif (vma_flags_test(\u0026vma_flags, VMA_SPARC_ADI_BIT))\nmm/ksm.c-762-\t\treturn false;\n--\nmm/ksm.c=2865=static bool __ksm_should_add_vma(const struct file *file, vma_flags_t vma_flags)\nmm/ksm.c-2866-{\nmm/ksm.c:2867:\tif (vma_flags_test(\u0026vma_flags, VMA_MERGEABLE_BIT))\nmm/ksm.c-2868-\t\treturn false;\n--\nmm/memfd.c=373=static int check_write_seal(vma_flags_t *vma_flags_ptr)\n--\nmm/memfd.c-375-\t/* If a private mapping then writability is irrelevant. */\nmm/memfd.c:376:\tif (!vma_flags_test(vma_flags_ptr, VMA_SHARED_BIT))\nmm/memfd.c-377-\t\treturn 0;\n--\nmm/memfd.c-382-\t */\nmm/memfd.c:383:\tif (vma_flags_test(vma_flags_ptr, VMA_WRITE_BIT))\nmm/memfd.c-384-\t\treturn -EPERM;\n--\nmm/mlock.c=423=static void mlock_vma_pages_range(struct vm_area_struct *vma,\n--\nmm/mlock.c-442-\t */\nmm/mlock.c:443:\tif (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))\nmm/mlock.c-444-\t\tvma_flags_set(new_vma_flags, VMA_IO_BIT);\n--\nmm/mlock.c-451-\nmm/mlock.c:452:\tif (vma_flags_test(new_vma_flags, VMA_IO_BIT)) {\nmm/mlock.c-453-\t\tvma_flags_clear(new_vma_flags, VMA_IO_BIT);\n--\nmm/mlock.c=467=static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,\n--\nmm/mlock.c-494-\tnr_pages = (end - start) \u003e\u003e PAGE_SHIFT;\nmm/mlock.c:495:\tif (!vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))\nmm/mlock.c-496-\t\tnr_pages = -nr_pages;\nmm/mlock.c:497:\telse if (vma_flags_test(\u0026old_vma_flags, VMA_LOCKED_BIT))\nmm/mlock.c-498-\t\tnr_pages = 0;\n--\nmm/mlock.c-505-\t */\nmm/mlock.c:506:\tif (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT) \u0026\u0026\nmm/mlock.c:507:\t vma_flags_test(\u0026old_vma_flags, VMA_LOCKED_BIT)) {\nmm/mlock.c-508-\t\t/* No work to do, and mlocking twice would be wrong */\n--\nmm/mlock.c=619=static __must_check int do_mlock(unsigned long start, size_t len,\n--\nmm/mlock.c-660-\nmm/mlock.c:661:\tif (!vma_flags_test(flags, VMA_LOCKONFAULT_BIT)) {\nmm/mlock.c-662-\t\terror = __mm_populate(start, len, 0);\n--\nmm/mmap.c=103=static int check_brk_limits(unsigned long addr, unsigned long len)\n--\nmm/mmap.c-106-\tconst bool is_def_locked =\nmm/mmap.c:107:\t\tvma_flags_test(\u0026mm-\u003edef_vma_flags, VMA_LOCKED_BIT);\nmm/mmap.c-108-\tunsigned long mapped_addr;\n--\nmm/mmap.c=117=SYSCALL_DEFINE1(brk, unsigned long, brk)\n--\nmm/mmap.c-200-\tmm-\u003ebrk = brk;\nmm/mmap.c:201:\tif (vma_flags_test(\u0026mm-\u003edef_vma_flags, VMA_LOCKED_BIT))\nmm/mmap.c-202-\t\tpopulate = true;\n--\nmm/mmap.c=338=unsigned long do_mmap(struct file *file, unsigned long addr,\n--\nmm/mmap.c-427-\nmm/mmap.c:428:\tif (!mlock_future_ok(mm, vma_flags_test(\u0026vma_flags, VMA_LOCKED_BIT), len))\nmm/mmap.c-429-\t\treturn -EAGAIN;\n--\nmm/mmap.c-479-\t\t\tif (path_noexec(\u0026file-\u003ef_path)) {\nmm/mmap.c:480:\t\t\t\tif (vma_flags_test(\u0026vma_flags, VMA_EXEC_BIT))\nmm/mmap.c-481-\t\t\t\t\treturn -EPERM;\n--\nmm/mmap.c-574-\tif (!IS_ERR_VALUE(addr) \u0026\u0026\nmm/mmap.c:575:\t (vma_flags_test(\u0026vma_flags, VMA_LOCKED_BIT) ||\nmm/mmap.c-576-\t (flags \u0026 (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE))\n--\nmm/mmap.c=661=static inline unsigned long stack_guard_placement(vma_flags_t vma_flags)\nmm/mmap.c-662-{\nmm/mmap.c:663:\tif (vma_flags_test_single_mask(\u0026vma_flags, VMA_SHADOW_STACK))\nmm/mmap.c-664-\t\treturn PAGE_SIZE;\n--\nmm/mmap.c=1220=int vm_brk_flags(unsigned long addr, unsigned long request, bool is_exec)\n--\nmm/mmap.c-1250-\tret = do_brk_flags(\u0026vmi, vma, addr, len, vma_flags);\nmm/mmap.c:1251:\tpopulate = vma_flags_test(\u0026mm-\u003edef_vma_flags, VMA_LOCKED_BIT);\nmm/mmap.c-1252-\tmmap_write_unlock(mm);\n--\nmm/mprotect.c=760=mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,\n--\nmm/mprotect.c-785-\tif (arch_has_pfn_modify_check() \u0026\u0026\nmm/mprotect.c:786:\t vma_flags_test_any(\u0026old_vma_flags, VMA_PFNMAP_BIT,\nmm/mprotect.c-787-\t\t\t VMA_MIXEDMAP_BIT) \u0026\u0026\nmm/mprotect.c:788:\t !vma_flags_test_any_mask(\u0026new_vma_flags, VMA_ACCESS_FLAGS)) {\nmm/mprotect.c-789-\t\tpgprot_t new_pgprot = vm_get_page_prot(newflags);\n--\nmm/mprotect.c-805-\t */\nmm/mprotect.c:806:\tif (vma_flags_test(\u0026new_vma_flags, VMA_WRITE_BIT)) {\nmm/mprotect.c-807-\t\t/* Check space limits when area turns into data. */\n--\nmm/mprotect.c-810-\t\t\treturn -ENOMEM;\nmm/mprotect.c:811:\t\tif (!vma_flags_test_any(\u0026old_vma_flags,\nmm/mprotect.c-812-\t\t\t\tVMA_ACCOUNT_BIT, VMA_WRITE_BIT, VMA_HUGETLB_BIT,\n--\nmm/mprotect.c-818-\t\t}\nmm/mprotect.c:819:\t} else if (vma_flags_test(\u0026old_vma_flags, VMA_ACCOUNT_BIT) \u0026\u0026\nmm/mprotect.c-820-\t\t vma_is_anonymous(vma) \u0026\u0026 !vma-\u003eanon_vma) {\n--\nmm/mprotect.c-843-\nmm/mprotect.c:844:\tif (vma_flags_test(\u0026old_vma_flags, VMA_ACCOUNT_BIT) \u0026\u0026\nmm/mprotect.c:845:\t !vma_flags_test(\u0026new_vma_flags, VMA_ACCOUNT_BIT))\nmm/mprotect.c-846-\t\tvm_unacct_memory(nrpages);\n--\nmm/mprotect.c-851-\t */\nmm/mprotect.c:852:\tif (vma_flags_test(\u0026new_vma_flags, VMA_WRITE_BIT) \u0026\u0026\nmm/mprotect.c:853:\t vma_flags_test(\u0026old_vma_flags, VMA_LOCKED_BIT) \u0026\u0026\nmm/mprotect.c:854:\t !vma_flags_test_any(\u0026old_vma_flags, VMA_WRITE_BIT, VMA_SHARED_BIT))\nmm/mprotect.c-855-\t\tpopulate_vma_page_range(vma, start, end, NULL);\n--\nmm/shmem.c=3011=static struct inode *__shmem_get_inode(struct mnt_idmap *idmap,\n--\nmm/shmem.c-3042-\tinfo-\u003eseals = F_SEAL_SEAL;\nmm/shmem.c:3043:\tinfo-\u003eflags = vma_flags_test(\u0026flags, VMA_NORESERVE_BIT)\nmm/shmem.c-3044-\t\t? SHMEM_F_NORESERVE : 0;\n--\nmm/shmem.c=5785=static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name,\n--\nmm/shmem.c-5789-\tconst unsigned long shmem_flags =\nmm/shmem.c:5790:\t\tvma_flags_test(\u0026flags, VMA_NORESERVE_BIT) ? SHMEM_F_NORESERVE : 0;\nmm/shmem.c-5791-\tstruct inode *inode;\n--\nmm/vma.c=50=static inline pgoff_t map_anon_pgoff(const struct mmap_state *map)\nmm/vma.c-51-{\nmm/vma.c:52:\tif (vma_flags_test(\u0026map-\u003evma_flags, VMA_SHARED_BIT))\nmm/vma.c-53-\t\treturn map-\u003epgoff;\n--\nmm/vma.c=876=static __must_check struct vm_area_struct *vma_merge_existing_range(\n--\nmm/vma.c-918-\t */\nmm/vma.c:919:\tif (vma_flags_test_any_mask(\u0026vmg-\u003evma_flags, VMA_SPECIAL_FLAGS) ||\nmm/vma.c-920-\t (!left_side \u0026\u0026 !right_side))\n--\nmm/vma.c=1127=struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg)\n--\nmm/vma.c-1142-\t/* Special VMAs are unmergeable, also if no prev/next. */\nmm/vma.c:1143:\tif (vma_flags_test_any_mask(\u0026vmg-\u003evma_flags, VMA_SPECIAL_FLAGS) ||\nmm/vma.c-1144-\t (!prev \u0026\u0026 !next))\n--\nmm/vma.c=2431=static bool accountable_mapping(struct mmap_state *map)\n--\nmm/vma.c-2441-\nmm/vma.c:2442:\treturn vma_flags_test(\u0026map-\u003evma_flags, VMA_WRITE_BIT) \u0026\u0026\nmm/vma.c:2443:\t\t!vma_flags_test_any(\u0026map-\u003evma_flags, VMA_NORESERVE_BIT,\nmm/vma.c-2444-\t\t\t\t VMA_SHARED_BIT);\n--\nmm/vma.c=2573=static int __mmap_new_file_vma(struct mmap_state *map,\n--\nmm/vma.c-2605-\tVM_WARN_ON_ONCE(!vma_flags_same_pair(\u0026map-\u003evma_flags, \u0026vma-\u003eflags) \u0026\u0026\nmm/vma.c:2606:\t\t\t!vma_flags_test(\u0026map-\u003evma_flags, VMA_MAYWRITE_BIT) \u0026\u0026\nmm/vma.c-2607-\t\t\tvma_test(vma, VMA_MAYWRITE_BIT));\n--\nmm/vma.c=2632=static bool map_is_private(const struct mmap_state *map)\nmm/vma.c-2633-{\nmm/vma.c:2634:\treturn !vma_flags_test(\u0026map-\u003evma_flags, VMA_SHARED_BIT);\nmm/vma.c-2635-}\n--\nmm/vma.c=3014=int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *vma,\n--\nmm/vma.c-3075-\tmm-\u003edata_vm += len \u003e\u003e PAGE_SHIFT;\nmm/vma.c:3076:\tif (vma_flags_test(\u0026vma_flags, VMA_LOCKED_BIT))\nmm/vma.c-3077-\t\tmm-\u003elocked_vm += (len \u003e\u003e PAGE_SHIFT);\n--\nmm/vma.h=669=static inline bool is_data_mapping_vma_flags(const vma_flags_t *vma_flags)\nmm/vma.h-670-{\nmm/vma.h:671:\treturn vma_flags_test(vma_flags, VMA_WRITE_BIT) \u0026\u0026\nmm/vma.h:672:\t\t!vma_flags_test_any(vma_flags, VMA_SHARED_BIT, VMA_STACK_BIT);\nmm/vma.h-673-}\n--\nmm/vma.h=872=static inline bool map_deny_write_exec(const vma_flags_t *old,\n--\nmm/vma.h-879-\t/* If the new VMA is not executable, we have nothing to deny. */\nmm/vma.h:880:\tif (!vma_flags_test(new, VMA_EXEC_BIT))\nmm/vma.h-881-\t\treturn false;\n--\nmm/vma.h-883-\t/* Under MDWE we do not accept newly writably executable VMAs... */\nmm/vma.h:884:\tif (vma_flags_test(new, VMA_WRITE_BIT))\nmm/vma.h-885-\t\treturn true;\n--\nmm/vma.h-887-\t/* ...nor previously non-executable VMAs becoming executable. */\nmm/vma.h:888:\tif (!vma_flags_test(old, VMA_EXEC_BIT))\nmm/vma.h-889-\t\treturn true;\n--\nmm/vma_exec.c=112=int create_init_stack_vma(struct mm_struct *mm, struct vm_area_struct **vmap,\n--\nmm/vma_exec.c-119-\t/* VMA_STACK_FLAGS and VMA_STACK_INCOMPLETE_SETUP must not overlap. */\nmm/vma_exec.c:120:\tVM_WARN_ON_ONCE(vma_flags_test_any_mask(\u0026flags, VMA_STACK_FLAGS));\nmm/vma_exec.c-121-\n--\nmm/vmscan.c=266=static inline bool is_exec_file_folio(const struct folio *folio,\n--\nmm/vmscan.c-268-{\nmm/vmscan.c:269:\treturn vma_flags_test(vma_flags, VMA_EXEC_BIT) \u0026\u0026 folio_is_file_lru(folio);\nmm/vmscan.c-270-}\n--\nmm/vmscan.c=867=static enum folio_references folio_check_references(struct folio *folio,\n--\nmm/vmscan.c-879-\t */\nmm/vmscan.c:880:\tif (vma_flags_test(\u0026vma_flags, VMA_LOCKED_BIT))\nmm/vmscan.c-881-\t\treturn FOLIOREF_ACTIVATE;\n--\nsecurity/selinux/hooks.c=7845=static __init int selinux_init(void)\n--\nsecurity/selinux/hooks.c-7864-\nsecurity/selinux/hooks.c:7865:\tdefault_noexec = !vma_flags_test(\u0026data_default_flags, VMA_EXEC_BIT);\nsecurity/selinux/hooks.c-7866-\tif (!default_noexec)\n--\ntools/testing/vma/include/dup.h=970=static __always_inline int vma_flags_count(const vma_flags_t *flags)\n--\ntools/testing/vma/include/dup.h-976-\ntools/testing/vma/include/dup.h:977:static __always_inline bool vma_flags_test(const vma_flags_t *flags,\ntools/testing/vma/include/dup.h-978-\t\tvma_flag_t bit)\n--\ntools/testing/vma/include/dup.h=985=static __always_inline vma_flags_t vma_flags_and_mask(const vma_flags_t *flags,\n--\ntools/testing/vma/include/dup.h-999-\ntools/testing/vma/include/dup.h:1000:static __always_inline bool vma_flags_test_any_mask(const vma_flags_t *flags,\ntools/testing/vma/include/dup.h-1001-\t\tvma_flags_t to_test)\n--\ntools/testing/vma/include/dup.h-1008-\ntools/testing/vma/include/dup.h:1009:#define vma_flags_test_any(flags, ...) \\\ntools/testing/vma/include/dup.h:1010:\tvma_flags_test_any_mask(flags, mk_vma_flags(__VA_ARGS__))\ntools/testing/vma/include/dup.h-1011-\ntools/testing/vma/include/dup.h:1012:static __always_inline bool vma_flags_test_all_mask(const vma_flags_t *flags,\ntools/testing/vma/include/dup.h-1013-\t\tvma_flags_t to_test)\n--\ntools/testing/vma/include/dup.h-1020-\ntools/testing/vma/include/dup.h:1021:#define vma_flags_test_all(flags, ...) \\\ntools/testing/vma/include/dup.h:1022:\tvma_flags_test_all_mask(flags, mk_vma_flags(__VA_ARGS__))\ntools/testing/vma/include/dup.h-1023-\ntools/testing/vma/include/dup.h:1024:static __always_inline bool vma_flags_test_single_mask(const vma_flags_t *flags,\ntools/testing/vma/include/dup.h-1025-\t\t\t\t\t\tvma_flags_t flagmask)\n--\ntools/testing/vma/include/dup.h-1028-\ntools/testing/vma/include/dup.h:1029:\treturn vma_flags_test_any_mask(flags, flagmask);\ntools/testing/vma/include/dup.h-1030-}\n--\ntools/testing/vma/include/dup.h=1087=static __always_inline bool vma_test(const struct vm_area_struct *vma,\n--\ntools/testing/vma/include/dup.h-1089-{\ntools/testing/vma/include/dup.h:1090:\treturn vma_flags_test(\u0026vma-\u003eflags, bit);\ntools/testing/vma/include/dup.h-1091-}\n--\ntools/testing/vma/include/dup.h=1093=static __always_inline bool vma_test_any_mask(const struct vm_area_struct *vma,\n--\ntools/testing/vma/include/dup.h-1095-{\ntools/testing/vma/include/dup.h:1096:\treturn vma_flags_test_any_mask(\u0026vma-\u003eflags, flags);\ntools/testing/vma/include/dup.h-1097-}\n--\ntools/testing/vma/include/dup.h=1102=static __always_inline bool vma_test_all_mask(const struct vm_area_struct *vma,\n--\ntools/testing/vma/include/dup.h-1104-{\ntools/testing/vma/include/dup.h:1105:\treturn vma_flags_test_all_mask(\u0026vma-\u003eflags, flags);\ntools/testing/vma/include/dup.h-1106-}\n--\ntools/testing/vma/include/dup.h=1112=vma_test_single_mask(const struct vm_area_struct *vma, vma_flags_t flagmask)\ntools/testing/vma/include/dup.h-1113-{\ntools/testing/vma/include/dup.h:1114:\treturn vma_flags_test_single_mask(\u0026vma-\u003eflags, flagmask);\ntools/testing/vma/include/dup.h-1115-}\n--\ntools/testing/vma/include/dup.h=1135=static __always_inline bool vma_desc_test(const struct vm_area_desc *desc,\n--\ntools/testing/vma/include/dup.h-1137-{\ntools/testing/vma/include/dup.h:1138:\treturn vma_flags_test(\u0026desc-\u003evma_flags, bit);\ntools/testing/vma/include/dup.h-1139-}\n--\ntools/testing/vma/include/dup.h=1141=static __always_inline bool vma_desc_test_any_mask(const struct vm_area_desc *desc,\n--\ntools/testing/vma/include/dup.h-1143-{\ntools/testing/vma/include/dup.h:1144:\treturn vma_flags_test_any_mask(\u0026desc-\u003evma_flags, flags);\ntools/testing/vma/include/dup.h-1145-}\n--\ntools/testing/vma/include/dup.h=1150=static __always_inline bool vma_desc_test_all_mask(const struct vm_area_desc *desc,\n--\ntools/testing/vma/include/dup.h-1152-{\ntools/testing/vma/include/dup.h:1153:\treturn vma_flags_test_all_mask(\u0026desc-\u003evma_flags, flags);\ntools/testing/vma/include/dup.h-1154-}\n--\ntools/testing/vma/include/dup.h=1177=static inline bool is_shared_maywrite(const vma_flags_t *flags)\ntools/testing/vma/include/dup.h-1178-{\ntools/testing/vma/include/dup.h:1179:\treturn vma_flags_test_all(flags, VMA_SHARED_BIT, VMA_MAYWRITE_BIT);\ntools/testing/vma/include/dup.h-1180-}\n--\ntools/testing/vma/tests/merge.c=251=static bool __test_merge_new(bool is_sticky, bool a_is_sticky, bool b_is_sticky, bool c_is_sticky)\n--\ntools/testing/vma/tests/merge.c-340-\tif (is_sticky || a_is_sticky || b_is_sticky)\ntools/testing/vma/tests/merge.c:341:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-342-\n--\ntools/testing/vma/tests/merge.c-360-\tif (is_sticky || a_is_sticky)\ntools/testing/vma/tests/merge.c:361:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-362-\n--\ntools/testing/vma/tests/merge.c-382-\tif (is_sticky) /* D uses is_sticky. */\ntools/testing/vma/tests/merge.c:383:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-384-\n--\ntools/testing/vma/tests/merge.c-403-\tif (is_sticky || a_is_sticky)\ntools/testing/vma/tests/merge.c:404:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-405-\n--\ntools/testing/vma/tests/merge.c-424-\tif (is_sticky || c_is_sticky)\ntools/testing/vma/tests/merge.c:425:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-426-\n--\ntools/testing/vma/tests/merge.c-444-\tif (is_sticky || a_is_sticky || c_is_sticky)\ntools/testing/vma/tests/merge.c:445:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-446-\n--\ntools/testing/vma/tests/merge.c=833=static bool __test_merge_existing(bool prev_is_sticky, bool middle_is_sticky, bool next_is_sticky)\n--\ntools/testing/vma/tests/merge.c-890-\tif (middle_is_sticky || next_is_sticky)\ntools/testing/vma/tests/merge.c:891:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma_next-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-892-\n--\ntools/testing/vma/tests/merge.c-920-\tif (middle_is_sticky || next_is_sticky)\ntools/testing/vma/tests/merge.c:921:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma_next-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-922-\n--\ntools/testing/vma/tests/merge.c-958-\tif (prev_is_sticky || middle_is_sticky)\ntools/testing/vma/tests/merge.c:959:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma_prev-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-960-\n--\ntools/testing/vma/tests/merge.c-990-\tif (prev_is_sticky || middle_is_sticky)\ntools/testing/vma/tests/merge.c:991:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma_prev-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-992-\n--\ntools/testing/vma/tests/merge.c-1023-\tif (prev_is_sticky || middle_is_sticky || next_is_sticky)\ntools/testing/vma/tests/merge.c:1024:\t\tASSERT_TRUE(vma_flags_test_any_mask(\u0026vma_prev-\u003eflags, VMA_STICKY_FLAGS));\ntools/testing/vma/tests/merge.c-1025-\n--\ntools/testing/vma/tests/vma.c=130=static bool test_vma_flags_word(void)\n--\ntools/testing/vma/tests/vma.c-173-\ntools/testing/vma/tests/vma.c:174:/* Ensure that vma_flags_test() and friends works correctly. */\ntools/testing/vma/tests/vma.c:175:static bool test_vma_flags_test(void)\ntools/testing/vma/tests/vma.c-176-{\n--\ntools/testing/vma/tests/vma.c-190-#define do_test(_flag)\t\t\t\t\t\t\t \\\ntools/testing/vma/tests/vma.c:191:\tASSERT_TRUE(vma_flags_test(\u0026flags, _flag));\t\t\t \\\ntools/testing/vma/tests/vma.c:192:\tASSERT_TRUE(vma_flags_test_single_mask(\u0026flags, mk_vma_flags(_flag))); \\\ntools/testing/vma/tests/vma.c-193-\tASSERT_TRUE(vma_test(\u0026vma, _flag));\t\t\t\t \\\n--\ntools/testing/vma/tests/vma.c-197-#define do_test_false(_flag)\t\t\t\t\t\t \\\ntools/testing/vma/tests/vma.c:198:\tASSERT_FALSE(vma_flags_test(\u0026flags, _flag));\t\t\t \\\ntools/testing/vma/tests/vma.c:199:\tASSERT_FALSE(vma_flags_test_single_mask(\u0026flags, mk_vma_flags(_flag))); \\\ntools/testing/vma/tests/vma.c-200-\tASSERT_FALSE(vma_test(\u0026vma, _flag));\t\t\t\t \\\n--\ntools/testing/vma/tests/vma.c-219-\t/* We define the _single_mask() variants to return false if empty. */\ntools/testing/vma/tests/vma.c:220:\tASSERT_FALSE(vma_flags_test_single_mask(\u0026flags, EMPTY_VMA_FLAGS));\ntools/testing/vma/tests/vma.c-221-\tASSERT_FALSE(vma_test_single_mask(\u0026vma, EMPTY_VMA_FLAGS));\n--\ntools/testing/vma/tests/vma.c-224-\tvma.flags = EMPTY_VMA_FLAGS;\ntools/testing/vma/tests/vma.c:225:\tASSERT_FALSE(vma_flags_test_single_mask(\u0026flags, EMPTY_VMA_FLAGS));\n\n"
} |
| 9/2 | 2026/07/23 13:14 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 15716 output: 35 thoughts: 211 Thoughts: **Analyzing the Memory Management Patch** Okay, so this patch is aimed at changing the behavior of `do_mlock` and `sys_mlockall`. My initial impression is that it's removing calls to `__mm_populate` or `mm_populate` when the `MLOCK_ONFAULT` flag is set. Ah, right, `MLOCK_ONFAULT` is specific to `mlock2` and `mlockall`. This is where it gets interesting. The fundamental concept here is that if `MLOCK_ONFAULT` is enabled, then `mlock` should only lock pages as they're accessed – on a fault – and not pre-populate them. This is an obvious functional alteration to how the memory management system works. It's not just a minor tweak; it's changing how the locking behavior is intended to function. So, the crux of the issue is a bug where either `mlock2` called with `MLOCK_ONFAULT`, or `mlockall` with `MCL_ONFAULT` have been incorrectly populating pages immediately. Hmm... let me see, in `mlock2` with `MLOCK_ONFAULT` it seems `VMA_LOCKONFAULT_BIT` is being set in `vma_flags`. I better examine `sys_mlock2` and `sys_mlockall` now to verify what is actually happening. |
| 10/2 | 2026/07/23 13:14 | tool | read-file |
0mArgs:{
"File": "mm/mlock.c",
"FirstLine": 669,
"LineCount": 100
}Results: {
"Contents": " 669:\tSYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)\n 670:\t{\n 671:\t\tvma_flags_t flags = mk_vma_flags(VMA_LOCKED_BIT);\n 672:\t\n 673:\t\treturn do_mlock(start, len, \u0026flags);\n 674:\t}\n 675:\t\n 676:\tSYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)\n 677:\t{\n 678:\t\tvma_flags_t vma_flags = mk_vma_flags(VMA_LOCKED_BIT);\n 679:\t\n 680:\t\tif (flags \u0026 ~MLOCK_ONFAULT)\n 681:\t\t\treturn -EINVAL;\n 682:\t\n 683:\t\tif (flags \u0026 MLOCK_ONFAULT)\n 684:\t\t\tvma_flags_set(\u0026vma_flags, VMA_LOCKONFAULT_BIT);\n 685:\t\n 686:\t\treturn do_mlock(start, len, \u0026vma_flags);\n 687:\t}\n 688:\t\n 689:\tSYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)\n 690:\t{\n 691:\t\tvma_flags_t flags = EMPTY_VMA_FLAGS;\n 692:\t\tint ret;\n 693:\t\n 694:\t\tstart = untagged_addr(start);\n 695:\t\n 696:\t\tlen = PAGE_ALIGN(len + (offset_in_page(start)));\n 697:\t\tstart \u0026= PAGE_MASK;\n 698:\t\n 699:\t\tif (mmap_write_lock_killable(current-\u003emm))\n 700:\t\t\treturn -EINTR;\n 701:\t\tret = apply_vma_lock_flags(start, len, \u0026flags);\n 702:\t\tmmap_write_unlock(current-\u003emm);\n 703:\t\n 704:\t\treturn ret;\n 705:\t}\n 706:\t\n 707:\t/*\n 708:\t * Take the MCL_* flags passed into mlockall (or 0 if called from munlockall)\n 709:\t * and translate into the appropriate modifications to mm-\u003edef_vma_flags and/or\n 710:\t * the flags for all current VMAs.\n 711:\t *\n 712:\t * There are a couple of subtleties with this. If mlockall() is called multiple\n 713:\t * times with different flags, the values do not necessarily stack. If mlockall\n 714:\t * is called once including the MCL_FUTURE flag and then a second time without\n 715:\t * it, VMA_LOCKED_BIT and VMA_LOCKONFAULT_BIT will be cleared from\n 716:\t * mm-\u003edef_vma_flags.\n 717:\t */\n 718:\tstatic int apply_mlockall_flags(int flags)\n 719:\t{\n 720:\t\tVMA_ITERATOR(vmi, current-\u003emm, 0);\n 721:\t\tstruct mm_struct *mm = current-\u003emm;\n 722:\t\tstruct vm_area_struct *vma, *prev = NULL;\n 723:\t\tvma_flags_t to_add = EMPTY_VMA_FLAGS;\n 724:\t\n 725:\t\tvma_flags_clear_mask(\u0026mm-\u003edef_vma_flags, VMA_LOCKED_MASK);\n 726:\t\tif (flags \u0026 MCL_FUTURE) {\n 727:\t\t\tvma_flags_set(\u0026mm-\u003edef_vma_flags, VMA_LOCKED_BIT);\n 728:\t\n 729:\t\t\tif (flags \u0026 MCL_ONFAULT)\n 730:\t\t\t\tvma_flags_set(\u0026mm-\u003edef_vma_flags, VMA_LOCKONFAULT_BIT);\n 731:\t\n 732:\t\t\tif (!(flags \u0026 MCL_CURRENT))\n 733:\t\t\t\tgoto out;\n 734:\t\t}\n 735:\t\n 736:\t\tif (flags \u0026 MCL_CURRENT) {\n 737:\t\t\tvma_flags_set(\u0026to_add, VMA_LOCKED_BIT);\n 738:\t\t\tif (flags \u0026 MCL_ONFAULT)\n 739:\t\t\t\tvma_flags_set(\u0026to_add, VMA_LOCKONFAULT_BIT);\n 740:\t\t}\n 741:\t\n 742:\t\tfor_each_vma(vmi, vma) {\n 743:\t\t\tint error;\n 744:\t\t\tvma_flags_t newflags = vma-\u003eflags;\n 745:\t\n 746:\t\t\tvma_flags_clear_mask(\u0026newflags, VMA_LOCKED_MASK);\n 747:\t\t\tvma_flags_set_mask(\u0026newflags, to_add);\n 748:\t\n 749:\t\t\terror = mlock_fixup(\u0026vmi, vma, \u0026prev, vma-\u003evm_start, vma-\u003evm_end,\n 750:\t\t\t\t\t \u0026newflags);\n 751:\t\t\t/* Ignore errors, but prev needs fixing up. */\n 752:\t\t\tif (error)\n 753:\t\t\t\tprev = vma;\n 754:\t\t\tcond_resched();\n 755:\t\t}\n 756:\tout:\n 757:\t\treturn 0;\n 758:\t}\n 759:\t\n 760:\tSYSCALL_DEFINE1(mlockall, int, flags)\n 761:\t{\n 762:\t\tunsigned long lock_limit;\n 763:\t\tint ret;\n 764:\t\n 765:\t\tif (!flags || (flags \u0026 ~(MCL_CURRENT | MCL_FUTURE | MCL_ONFAULT)) ||\n 766:\t\t flags == MCL_ONFAULT)\n 767:\t\t\treturn -EINVAL;\n 768:\t\n"
} |
| 11/2 | 2026/07/23 13:14 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 17851 output: 24 thoughts: 258 Thoughts: **My Analysis of the MLOCK Patch** Okay, so this patch seems to be addressing how `MLOCK_ONFAULT` interacts with memory population, specifically preventing `__mm_populate` and `mm_populate` from being called in that scenario. Functionally, this is a change I need to consider for fuzzing. Given the nature of the change, my attention immediately turns to the system calls involved. I know that `sys_mlock2` and `sys_mlockall` are the obvious candidates for focused fuzzing. Let's see... `sys_mlock2`... right, it's actually `__x64_sys_mlock2` or something similar on different architectures, but the entry point we're interested in is effectively `mlock2`. I think I can simplify this to just listing the core functions. So I'll target `mlock2` and `mlockall`, or maybe even the underlying `do_mlock` and `apply_mlockall_flags` functions. Ah, hang on a second. I need to be more precise about the system call names, to make sure I don't miss anything. `sys_mlock2` is defined using the `SYSCALL_DEFINE3(mlock2, ...)` macro. That confirms it. So the function name I'm looking for is definitely `sys_mlock2`. Okay, so let's consolidate the function names: `do_mlock`, `sys_mlock2`, `sys_mlockall`, and `apply_mlockall_flags`. Now, before I dig too deep into fuzzing strategy, I want to confirm if any specific kernel configurations might be relevant. It's usually good to check for dependencies, right? However, `mlock` is a pretty core feature, I doubt it's conditionally compiled. Likely it's always enabled or it depends on `CONFIG_MMU`. To be sure, I'll quickly check `mm/Kconfig` or maybe even `init/Kconfig` for any `mlock` configuration options. |
| 12/2 | 2026/07/23 13:14 | tool | grepper |
0mArgs:{
"Expression": "config.*MLOCK",
"PathPrefix": ""
}Results: {
"Output": "drivers/pci/controller/vmd.c=581=static int vmd_get_phys_offsets(struct vmd_dev *vmd, bool native_hint,\n--\ndrivers/pci/controller/vmd.c-591-\ndrivers/pci/controller/vmd.c:592:\t\tret = pci_read_config_dword(dev, PCI_REG_VMLOCK, \u0026vmlock);\ndrivers/pci/controller/vmd.c-593-\t\tif (ret || PCI_POSSIBLE_ERROR(vmlock))\n"
} |
| 13/2 | 2026/07/23 13:14 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 18730 output: 25 thoughts: 69 Thoughts: **Investigating the Configuration for mlock** Okay, so I'm digging into this `mlock` situation. My initial thought was that it probably doesn't have its own dedicated configuration option. It's more of a core memory management functionality, I'd assume, integrated with the kernel's overall memory handling. Wait a second...I vaguely recall something about `mlock` and the Memory Management Unit. Ah, right! The `CONFIG_MMU` option. It seems like `mlock`'s availability is fundamentally linked to having an MMU. Makes sense – without an MMU, the whole concept of locking physical pages would be pretty irrelevant, right? You're usually only playing with virtual addresses with an MMU and that's the point of the locking. Alright, time to get a little more definitive. Let's head over to the `mm/Makefile` and see if there are any conditional compilations related to `mlock`. I want to confirm whether it's always included when the MMU is available, or if there is another configuration flag that controls it's inclusion, or exclusion. |
| 14/2 | 2026/07/23 13:14 | tool | grepper |
0mArgs:{
"Expression": "mlock",
"PathPrefix": "mm/Makefile"
}Results: {
"Output": "mm/Makefile=37=mmu-$(CONFIG_MMU)\t:= highmem.o memory.o mincore.o \\\nmm/Makefile:38:\t\t\t mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \\\nmm/Makefile-39-\t\t\t msync.o page_vma_mapped.o pagewalk.o \\\n"
} |
| 15/2 | 2026/07/23 13:14 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 19166 output: 122 thoughts: 596 Thoughts: **My Analysis of the `mlock` Patch for Fuzzing**
Okay, so I've been looking at this patch and here's my thought process. First, I confirmed that `mlock.o` is compiled when `CONFIG_MMU` is enabled, which is the expected behavior. I don't need to explicitly state `CONFIG_MMU` because it's a generic config, so that's not important.
Let's break down the fuzzing target. The core of this patch's impact revolves around the changes to `mlock2` and `mlockall` syscalls when the `MLOCK_ONFAULT` flag is set. Essentially, the patch prevents immediate page population. This means the changed behavior is core functionality within the memory management subsystem.
Now, considering fuzzing, I initially considered the syscall functions directly, like `sys_mlock2` and `sys_mlockall`, but I realized I need to be careful with architecture-specific naming. For example, on x86-64, the functions are actually named `__x64_sys_mlock2`, and I don't want to get confused. Syzkaller uses the kernel symbol names, but I need to make sure I get the actual function names.
Thinking it through, `do_mlock` and `apply_mlockall_flags` are the *better* targets. They are architecture-independent and reflect the core logic being modified. But, to make sure I cover all bases, I'll include `sys_mlockall` and `sys_mlock2` in the set as well.
I've reviewed the patch's C code again to ensure my reasoning is correct. I can see the changes in `do_mlock` with the VMA check and the changes inside `sys_mlockall` too:
```c
- error = __mm_populate(start, len, 0);
- if (error)
- return __mlock_posix_error_return(error);
+ if (!vma_flags_test(flags, VMA_LOCKONFAULT_BIT)) {
+ error = __mm_populate(start, len, 0);
+ if (error)
+ return __mlock_posix_error_return(error);
+ }
```
```c
- if (!ret && (flags & MCL_CURRENT))
+ if (!ret && (flags & MCL_CURRENT) && !(flags & MCL_ONFAULT))
mm_populate(0, TASK_SIZE);
```
The patch clearly addresses a functional change in how `mlock` with the `ONFAULT` flag should behave. It prevents the immediate page population that was happening, which defeats the point of the flag. This means core kernel code is reachable and should be considered for fuzzing.
I'm confident in this assessment. I'll flag it as worth fuzzing. I'll call `set-results`.
|
| 16/2 | 2026/07/23 13:14 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [
"do_mlock",
"apply_mlockall_flags",
"sys_mlockall",
"sys_mlock2"
],
"Reasoning": "The patch modifies the behavior of mlock2 and mlockall syscalls when the MLOCK_ONFAULT (or MCL_ONFAULT) flag is specified, preventing the immediate population of memory pages. This is a functional change in the core memory management subsystem that is reachable from user space.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": null,
"FocusSymbols": [
"do_mlock",
"apply_mlockall_flags",
"sys_mlockall",
"sys_mlock2"
],
"Reasoning": "The patch modifies the behavior of mlock2 and mlockall syscalls when the MLOCK_ONFAULT (or MCL_ONFAULT) flag is specified, preventing the immediate population of memory pages. This is a functional change in the core memory management subsystem that is reachable from user space.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|