| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/10/28 17:21 | flow | patch-triage |
7mArgs:null Results: {
"EnableConfigs": [
"TMPFS",
"TMPFS_POSIX_ACL",
"TMPFS_QUOTA",
"HUGETLBFS",
"MEMFD_CREATE",
"NUMA"
],
"FocusSymbols": [
"shmem_undo_range",
"shmem_setattr",
"hugetlbfs_setattr",
"shmem_set_acl",
"shmem_writeout",
"shmem_unuse",
"shmem_release_dquot",
"shmem_get_partial_folio",
"shmem_swapin_folio"
],
"KMSANReasoning": "The patch series consists of several distinct fixes and improvements across hugetlbfs, memfd, mempolicy, and shmem:\n1. memfd seal enforcement: Adds `memfd_check_seals_mode()` to check `F_SEAL_EXEC` against mode changes in `hugetlbfs_setattr()`, `shmem_setattr()`, and tmpfs POSIX ACL sets (`shmem_set_acl()`).\n2. mempolicy slab accounting: Marks `policy_cache` and `sn_cache` with `SLAB_ACCOUNT`.\n3. shmem swap and folio management: Refines swap accounting and cleanup in `shmem_undo_range()` and `shmem_free_swap()`, marks dirty large folios to avoid discard on split failure, synchronizes inode eviction with writeout using `stop_eviction`, and fixes swap entry validation upon swapin failure.\n4. shmem quota: Updates `shmem_is_default_dquot()` to check soft limits and mount default limits.\n\nNone of these changes introduce or expose uninitialized memory:\n- No structures or buffers are copied to user space (no info-leaks).\n- No new uninitialized heap or stack variables are allocated, read, or branched upon.\n- Surrounding buffer access and folio data operations do not read uninitialized bytes.\n\nAny potential bugs introduced by these modifications would be synchronization/locking races (e.g., around `stop_eviction` or swap lists), page/folio refcounting or lifecycle bugs (such as use-after-free), or logic errors—all of which are covered by KASAN, LOCKDEP, and mm assertions. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies core memory management, tmpfs, hugetlbfs, and shmem quota code. Key changes include enforcing file seals (F_SEAL_EXEC) during chmod and ACL modification in both tmpfs and hugetlbfs (hugetlbfs_setattr, shmem_setattr, shmem_set_acl), handling large folio splitting and swap entry bounds to prevent infinite loops during shmem truncation and hole punching (shmem_undo_range, shmem_get_partial_folio), synchronizing inode eviction with swapout and swapoff using stop_eviction counters (shmem_writeout, shmem_unuse, shmem_evict_inode), and refining default dquot checks in shmem quota management (shmem_release_dquot). All modified paths are directly reachable in virtualized environments via syscalls such as memfd_create, fchmod, fallocate, truncate, setfacl, quotactl, and swapoff.",
"WorthFuzzing": true
} |
| 1/1 | 2026/10/28 17:21 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit e1f9345f3463ab3370b0542f1b4c5e5acb9320bb\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Wed Oct 28 17:21:15 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c\nindex 01c4d6f44ebe0a..02e0a65d596d86 100644\n--- a/fs/hugetlbfs/inode.c\n+++ b/fs/hugetlbfs/inode.c\n@@ -28,6 +28,7 @@\n #include \u003clinux/folio_batch.h\u003e\n #include \u003clinux/fs_parser.h\u003e\n #include \u003clinux/mman.h\u003e\n+#include \u003clinux/memfd.h\u003e\n #include \u003clinux/slab.h\u003e\n #include \u003clinux/dnotify.h\u003e\n #include \u003clinux/statfs.h\u003e\n@@ -840,6 +841,13 @@ static int hugetlbfs_setattr(const struct mnt_idmap *idmap,\n \tif (error)\n \t\treturn error;\n \n+\tif (S_ISREG(inode-\u003ei_mode) \u0026\u0026 (ia_valid \u0026 ATTR_MODE)) {\n+\t\terror = memfd_check_seals_mode(info-\u003eseals, inode-\u003ei_mode,\n+\t\t\t\t\t attr-\u003eia_mode);\n+\t\tif (error)\n+\t\t\treturn error;\n+\t}\n+\n \ttrace_hugetlbfs_setattr(inode, dentry, attr);\n \n \tif (ia_valid \u0026 ATTR_SIZE) {\ndiff --git a/include/linux/memfd.h b/include/linux/memfd.h\nindex c159e40e3f34a0..272479317cf10c 100644\n--- a/include/linux/memfd.h\n+++ b/include/linux/memfd.h\n@@ -2,10 +2,19 @@\n #ifndef __LINUX_MEMFD_H\n #define __LINUX_MEMFD_H\n \n+#include \u003clinux/fcntl.h\u003e\n #include \u003clinux/file.h\u003e\n \n #define MEMFD_ANON_NAME \"[memfd]\"\n \n+static inline int memfd_check_seals_mode(unsigned int seals, umode_t old_mode,\n+\t\tumode_t new_mode)\n+{\n+\tif ((seals \u0026 F_SEAL_EXEC) \u0026\u0026 ((old_mode ^ new_mode) \u0026 0111))\n+\t\treturn -EPERM;\n+\treturn 0;\n+}\n+\n #ifdef CONFIG_MEMFD_CREATE\n extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);\n struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);\ndiff --git a/mm/mempolicy.c b/mm/mempolicy.c\nindex 0884c629670dd6..4da1cb8777f681 100644\n--- a/mm/mempolicy.c\n+++ b/mm/mempolicy.c\n@@ -3372,11 +3372,11 @@ void __init numa_policy_init(void)\n \n \tpolicy_cache = kmem_cache_create(\"numa_policy\",\n \t\t\t\t\t sizeof(struct mempolicy),\n-\t\t\t\t\t 0, SLAB_PANIC, NULL);\n+\t\t\t\t\t 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);\n \n \tsn_cache = kmem_cache_create(\"shared_policy_node\",\n \t\t\t\t sizeof(struct sp_node),\n-\t\t\t\t 0, SLAB_PANIC, NULL);\n+\t\t\t\t 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);\n \n \tfor_each_node(nid) {\n \t\tpreferred_node_policy[nid] = (struct mempolicy) {\ndiff --git a/mm/shmem.c b/mm/shmem.c\nindex af21a89abb0f63..9e51768ef46ccb 100644\n--- a/mm/shmem.c\n+++ b/mm/shmem.c\n@@ -77,6 +77,7 @@ static struct vfsmount *shm_mnt __ro_after_init;\n #include \u003clinux/magic.h\u003e\n #include \u003clinux/syscalls.h\u003e\n #include \u003clinux/fcntl.h\u003e\n+#include \u003clinux/memfd.h\u003e\n #include \u003cuapi/linux/memfd.h\u003e\n #include \u003clinux/rmap.h\u003e\n #include \u003clinux/uuid.h\u003e\n@@ -1176,12 +1177,11 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap)\n }\n \n /*\n- * Remove swap entry from page cache, free the swap and its page cache. Returns\n- * the number of pages being freed. 0 means entry not found in XArray (0 pages\n- * being freed).\n+ * Remove a swap entry or swapin-error marker wholly within [index, end].\n+ * Return whether it was removed, counting freed swap pages in nr_swaps_freed.\n */\n-static long shmem_free_swap(struct address_space *mapping,\n-\t\t\t pgoff_t index, pgoff_t end, void *radswap)\n+static bool shmem_free_swap(struct address_space *mapping,\n+\t\tpgoff_t index, pgoff_t end, void *radswap, long *nr_swaps_freed)\n {\n \tXA_STATE(xas, \u0026mapping-\u003ei_pages, index);\n \tconst softleaf_t swp = radix_to_swp_entry(radswap);\n@@ -1202,8 +1202,10 @@ static long shmem_free_swap(struct address_space *mapping,\n \txas_unlock_irq(\u0026xas);\n \n \t/* A swapin-error marker holds no swap slot, so just drop it. */\n-\tif (nr_pages \u0026\u0026 softleaf_is_swap(swp))\n+\tif (nr_pages \u0026\u0026 softleaf_is_swap(swp)) {\n \t\tswap_put_entries_direct(swp, nr_pages);\n+\t\t*nr_swaps_freed += nr_pages;\n+\t}\n \n \treturn nr_pages;\n }\n@@ -1297,12 +1299,10 @@ void shmem_unlock_mapping(struct address_space *mapping)\n \n static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)\n {\n+\tconst gfp_t gfp = mapping_gfp_mask(inode-\u003ei_mapping);\n \tstruct folio *folio;\n \n-\t/*\n-\t * At first avoid shmem_get_folio(,,,SGP_READ): that fails\n-\t * beyond i_size, and reports fallocated folios as holes.\n-\t */\n+retry:\n \tfolio = filemap_get_entry(inode-\u003ei_mapping, index);\n \tif (!folio)\n \t\treturn folio;\n@@ -1313,13 +1313,14 @@ static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)\n \t\t/* The folio has been swapped out */\n \t\tfolio_unlock(folio);\n \t\tfolio_put(folio);\n+\t\tgoto retry;\n \t}\n \t/*\n-\t * But read a folio back from swap if any of it is within i_size\n-\t * (although in some cases this is just a waste of time).\n+\t * Truncation can look up a large swap entry at or beyond i_size.\n+\t * Swap it in directly to bypass the size check in shmem_get_folio().\n \t */\n-\tfolio = NULL;\n-\tshmem_get_folio(inode, index, 0, \u0026folio, SGP_READ);\n+\tif (shmem_swapin_folio(inode, index, \u0026folio, SGP_READ, gfp, NULL, NULL) == -EEXIST)\n+\t\tgoto retry;\n \treturn folio;\n }\n \n@@ -1358,8 +1359,8 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\n \t\t\tif (xa_is_value(folio)) {\n \t\t\t\tif (unfalloc)\n \t\t\t\t\tcontinue;\n-\t\t\t\tnr_swaps_freed += shmem_free_swap(mapping, indices[i],\n-\t\t\t\t\t\t\t\t end - 1, folio);\n+\t\t\t\tshmem_free_swap(mapping, indices[i], end - 1,\n+\t\t\t\t\t\tfolio, \u0026nr_swaps_freed);\n \t\t\t\tcontinue;\n \t\t\t}\n \n@@ -1422,32 +1423,31 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\n \n \t\t\tif (xa_is_value(folio)) {\n \t\t\t\tint order;\n-\t\t\t\tlong swaps_freed;\n \n \t\t\t\tif (unfalloc)\n \t\t\t\t\tcontinue;\n-\t\t\t\tswaps_freed = shmem_free_swap(mapping, indices[i],\n-\t\t\t\t\t\t\t end - 1, folio);\n-\t\t\t\tif (!swaps_freed) {\n+\t\t\t\tif (!shmem_free_swap(mapping, indices[i], end - 1,\n+\t\t\t\t\t\t folio, \u0026nr_swaps_freed)) {\n \t\t\t\t\tpgoff_t base = indices[i];\n \n \t\t\t\t\torder = shmem_confirm_swap(mapping, indices[i],\n \t\t\t\t\t\t\t\t radix_to_swp_entry(folio));\n \t\t\t\t\t/*\n-\t\t\t\t\t * If found a large swap entry cross the end or start\n-\t\t\t\t\t * border, skip it as the truncate_inode_partial_folio\n-\t\t\t\t\t * above should have at least zerod its content once.\n+\t\t\t\t\t * Skip boundary entries when restarting\n+\t\t\t\t\t * the scan to avoid endless loops after\n+\t\t\t\t\t * swapin failure.\n \t\t\t\t\t */\n \t\t\t\t\tif (order \u003e 0) {\n \t\t\t\t\t\tbase = round_down(base, 1 \u003c\u003c order);\n-\t\t\t\t\t\tif (base \u003c start || base + (1 \u003c\u003c order) \u003e end)\n+\t\t\t\t\t\tif (base \u003c start || base + (1 \u003c\u003c order) \u003e end) {\n+\t\t\t\t\t\t\tstart = max(start, base + (1 \u003c\u003c order));\n \t\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t/* Swap was replaced by page or extended, retry */\n \t\t\t\t\tindex = base;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n-\t\t\t\tnr_swaps_freed += swaps_freed;\n \t\t\t\tcontinue;\n \t\t\t}\n \n@@ -1463,23 +1463,35 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\n \t\t\t\tVM_BUG_ON_FOLIO(folio_test_writeback(folio),\n \t\t\t\t\t\tfolio);\n \n-\t\t\t\tif (!folio_test_large(folio)) {\n+\t\t\t\t/*\n+\t\t\t\t * A shared mapping can have dirty PTEs while\n+\t\t\t\t * the folio is still clean. Mark the folio\n+\t\t\t\t * dirty so a failed split cannot discard data\n+\t\t\t\t * outside the range.\n+\t\t\t\t */\n+\t\t\t\tif (!unfalloc \u0026\u0026 folio_test_large(folio))\n+\t\t\t\t\tfolio_mark_dirty(folio);\n+\n+\t\t\t\tif (unfalloc || !folio_test_large(folio)) {\n \t\t\t\t\ttruncate_inode_folio(mapping, folio);\n \t\t\t\t} else if (truncate_inode_partial_folio(folio,\n \t\t\t\t\t\tlstart, lend, NULL, NULL)) {\n \t\t\t\t\t/*\n-\t\t\t\t\t * If we split a page, reset the loop so\n-\t\t\t\t\t * that we pick up the new sub pages.\n-\t\t\t\t\t * Otherwise the THP was entirely\n-\t\t\t\t\t * dropped or the target range was\n-\t\t\t\t\t * zeroed, so just continue the loop as\n-\t\t\t\t\t * is.\n+\t\t\t\t\t * The folio was split. Retry the scan\n+\t\t\t\t\t * to find the split folios.\n \t\t\t\t\t */\n-\t\t\t\t\tif (!folio_test_large(folio)) {\n-\t\t\t\t\t\tfolio_unlock(folio);\n-\t\t\t\t\t\tindex = start;\n-\t\t\t\t\t\tbreak;\n-\t\t\t\t\t}\n+\t\t\t\t\tfolio_unlock(folio);\n+\t\t\t\t\tindex = start;\n+\t\t\t\t\tbreak;\n+\t\t\t\t} else if (folio-\u003emapping) {\n+\t\t\t\t\t/*\n+\t\t\t\t\t * Splitting failed, but the part in the\n+\t\t\t\t\t * range is already zeroed. The folio\n+\t\t\t\t\t * was not dropped, so skip it when\n+\t\t\t\t\t * restarting the scan to avoid retrying\n+\t\t\t\t\t * it forever.\n+\t\t\t\t\t */\n+\t\t\t\t\tstart = max(start, folio_next_index(folio));\n \t\t\t\t}\n \t\t\t}\n \t\t\tfolio_unlock(folio);\n@@ -1546,10 +1558,11 @@ static int shmem_setattr(const struct mnt_idmap *idmap,\n \tif (error)\n \t\treturn error;\n \n-\tif ((info-\u003eseals \u0026 F_SEAL_EXEC) \u0026\u0026 (attr-\u003eia_valid \u0026 ATTR_MODE)) {\n-\t\tif ((inode-\u003ei_mode ^ attr-\u003eia_mode) \u0026 0111) {\n-\t\t\treturn -EPERM;\n-\t\t}\n+\tif (attr-\u003eia_valid \u0026 ATTR_MODE) {\n+\t\terror = memfd_check_seals_mode(info-\u003eseals, inode-\u003ei_mode,\n+\t\t\t\t\t attr-\u003eia_mode);\n+\t\tif (error)\n+\t\t\treturn error;\n \t}\n \n \tif (S_ISREG(inode-\u003ei_mode) \u0026\u0026 (attr-\u003eia_valid \u0026 ATTR_SIZE)) {\n@@ -1578,7 +1591,8 @@ static int shmem_setattr(const struct mnt_idmap *idmap,\n \t\t\tif (oldsize \u003e holebegin)\n \t\t\t\tunmap_mapping_range(inode-\u003ei_mapping,\n \t\t\t\t\t\t\tholebegin, 0, 1);\n-\t\t\tif (info-\u003ealloced)\n+\t\t\t/* Swapin-error markers are not counted in alloced. */\n+\t\t\tif (info-\u003ealloced || !mapping_empty(inode-\u003ei_mapping))\n \t\t\t\tshmem_truncate_range(inode,\n \t\t\t\t\t\t\tnewsize, (loff_t)-1);\n \t\t\t/* unmap again to remove racily COWed private pages */\n@@ -1614,6 +1628,17 @@ static int shmem_setattr(const struct mnt_idmap *idmap,\n \treturn error;\n }\n \n+static void shmem_disallow_eviction(struct shmem_inode_info *info)\n+{\n+\tatomic_inc(\u0026info-\u003estop_eviction);\n+}\n+\n+static void shmem_allow_eviction(struct shmem_inode_info *info)\n+{\n+\tif (atomic_dec_and_test(\u0026info-\u003estop_eviction))\n+\t\twake_up_var(\u0026info-\u003estop_eviction);\n+}\n+\n static void shmem_evict_inode(struct inode *inode)\n {\n \tstruct shmem_inode_info *info = SHMEM_I(inode);\n@@ -1626,16 +1651,21 @@ static void shmem_evict_inode(struct inode *inode)\n \t\tmapping_set_exiting(inode-\u003ei_mapping);\n \t\tshmem_truncate_range(inode, 0, (loff_t)-1);\n \t\tshmem_unused_huge_del(inode);\n-\t\twhile (!list_empty(\u0026info-\u003eswaplist)) {\n-\t\t\t/* Wait while shmem_unuse() is scanning this inode... */\n+\t\t/*\n+\t\t * Writeout may still use the inode after swapoff has removed it\n+\t\t * from the swaplist, so always wait at least once.\n+\t\t */\n+\t\tdo {\n \t\t\twait_var_event(\u0026info-\u003estop_eviction,\n \t\t\t\t !atomic_read(\u0026info-\u003estop_eviction));\n+\t\t\tif (list_empty(\u0026info-\u003eswaplist))\n+\t\t\t\tbreak;\n \t\t\tspin_lock(\u0026shmem_swaplist_lock);\n \t\t\t/* ...but beware of the race if we peeked too early */\n \t\t\tif (!atomic_read(\u0026info-\u003estop_eviction))\n \t\t\t\tlist_del_init(\u0026info-\u003eswaplist);\n \t\t\tspin_unlock(\u0026shmem_swaplist_lock);\n-\t\t}\n+\t\t} while (!list_empty(\u0026info-\u003eswaplist));\n \t}\n \n \tsimple_xattrs_free(\u0026sbinfo-\u003exa_cache, \u0026info-\u003exattrs, sbinfo-\u003emax_inodes ? \u0026freed : NULL);\n@@ -1774,15 +1804,14 @@ int shmem_unuse(unsigned int type)\n \t\t * remove placeholder inode from swaplist, nor let it be freed\n \t\t * (igrab() would protect from unlink, but not from unmount).\n \t\t */\n-\t\tatomic_inc(\u0026info-\u003estop_eviction);\n+\t\tshmem_disallow_eviction(info);\n \t\tspin_unlock(\u0026shmem_swaplist_lock);\n \n \t\terror = shmem_unuse_inode(\u0026info-\u003evfs_inode, type);\n \t\tcond_resched();\n \n \t\tspin_lock(\u0026shmem_swaplist_lock);\n-\t\tif (atomic_dec_and_test(\u0026info-\u003estop_eviction))\n-\t\t\twake_up_var(\u0026info-\u003estop_eviction);\n+\t\tshmem_allow_eviction(info);\n \t\tif (error)\n \t\t\tbreak;\n \t\tif (list_empty(\u0026info-\u003eswaplist))\n@@ -1913,6 +1942,13 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\n \t\t\tspin_unlock(\u0026shmem_swaplist_lock);\n \t\t}\n \n+\t\t/*\n+\t\t * Once the folio has left the page cache, its lock no longer\n+\t\t * keeps the inode from being evicted and freed: hold eviction\n+\t\t * off, in case the folio has to be put back below.\n+\t\t */\n+\t\tshmem_disallow_eviction(info);\n+\n \t\tfolio_dup_swap(folio, NULL);\n \t\tshmem_delete_from_page_cache(folio, swp_to_radix_entry(folio-\u003eswap));\n \n@@ -1920,6 +1956,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\n \t\terror = swap_writeout(ctx, folio);\n \t\tif (error != AOP_WRITEPAGE_ACTIVATE) {\n \t\t\t/* folio has been unlocked */\n+\t\t\tshmem_allow_eviction(info);\n \t\t\treturn error;\n \t\t}\n \n@@ -1936,6 +1973,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\n \t\t\tshmem_recalc_inode(inode, 0, -nr_pages);\n \t\t\tfolio_put_swap(folio, NULL);\n \t\t}\n+\t\tshmem_allow_eviction(info);\n \n \t\t/*\n \t\t * The swap_cache_del_folio() below could be left for\n@@ -2370,11 +2408,10 @@ static void shmem_set_folio_swapin_error(struct inode *inode, pgoff_t index,\n \tfolio_put_swap(folio, NULL);\n \tswap_cache_del_folio(folio);\n \t/*\n-\t * Don't treat swapin error folio as alloced. Otherwise inode-\u003ei_blocks\n-\t * won't be 0 when inode is released and thus trigger WARN_ON(i_blocks)\n-\t * in shmem_evict_inode().\n+\t * Let shmem_recalc_inode() reduce alloced and release the block charge\n+\t * for the freed swap pages.\n \t */\n-\tshmem_recalc_inode(inode, -nr_pages, -nr_pages);\n+\tshmem_recalc_inode(inode, 0, -nr_pages);\n }\n \n static int shmem_split_large_entry(struct inode *inode, pgoff_t index,\n@@ -2515,6 +2552,8 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,\n \t\t\telse\n \t\t\t\terror = -ENOMEM;\n \t\t\tfolio = NULL;\n+\t\t\t/* Make sure to validate the original value. */\n+\t\t\tswap = index_entry;\n \t\t\tgoto failed;\n \t\t}\n \t\tif (fault_type) {\n@@ -5404,12 +5443,35 @@ static const struct file_operations shmem_file_operations = {\n #endif\n };\n \n+#ifdef CONFIG_TMPFS_POSIX_ACL\n+static int shmem_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,\n+\t\tstruct posix_acl *acl, int type)\n+{\n+\tstruct inode *inode = d_inode(dentry);\n+\tumode_t mode = inode-\u003ei_mode;\n+\tint error;\n+\n+\tif (type == ACL_TYPE_ACCESS) {\n+\t\terror = posix_acl_equiv_mode(acl, \u0026mode);\n+\t\tif (error \u003c 0)\n+\t\t\treturn error;\n+\t\terror = memfd_check_seals_mode(SHMEM_I(inode)-\u003eseals,\n+\t\t\t\t\t inode-\u003ei_mode, mode);\n+\t\tif (error)\n+\t\t\treturn error;\n+\t}\n+\treturn simple_set_acl(idmap, dentry, acl, type);\n+}\n+#else\n+#define shmem_set_acl NULL\n+#endif\n+\n static const struct inode_operations shmem_inode_operations = {\n \t.getattr\t= shmem_getattr,\n \t.setattr\t= shmem_setattr,\n #ifdef CONFIG_TMPFS_XATTR\n \t.listxattr\t= shmem_listxattr,\n-\t.set_acl\t= simple_set_acl,\n+\t.set_acl\t= shmem_set_acl,\n \t.fileattr_get\t= shmem_fileattr_get,\n \t.fileattr_set\t= shmem_fileattr_set,\n #endif\ndiff --git a/mm/shmem_quota.c b/mm/shmem_quota.c\nindex a3fa4bd93e753a..d191ebda3f00e5 100644\n--- a/mm/shmem_quota.c\n+++ b/mm/shmem_quota.c\n@@ -239,7 +239,7 @@ static int shmem_acquire_dquot(struct dquot *dquot)\n \treturn ret;\n }\n \n-static bool shmem_is_empty_dquot(struct dquot *dquot)\n+static bool shmem_is_default_dquot(struct dquot *dquot)\n {\n \tstruct shmem_sb_info *sbinfo = dquot-\u003edq_sb-\u003es_fs_info;\n \tqsize_t bhardlimit;\n@@ -253,19 +253,21 @@ static bool shmem_is_empty_dquot(struct dquot *dquot)\n \t\tihardlimit = sbinfo-\u003eqlimits.grpquota_ihardlimit;\n \t}\n \n-\tif (test_bit(DQ_FAKE_B, \u0026dquot-\u003edq_flags) ||\n-\t\t(dquot-\u003edq_dqb.dqb_curspace == 0 \u0026\u0026\n-\t\t dquot-\u003edq_dqb.dqb_curinodes == 0 \u0026\u0026\n-\t\t dquot-\u003edq_dqb.dqb_bhardlimit == bhardlimit \u0026\u0026\n-\t\t dquot-\u003edq_dqb.dqb_ihardlimit == ihardlimit))\n-\t\treturn true;\n-\n-\treturn false;\n+\t/*\n+\t * Defaults are zero usage and soft limits, and the mount's hard limits.\n+\t * DQ_FAKE_B only means that *all* limits are zero, which need not match\n+\t * the mount defaults.\n+\t */\n+\treturn dquot-\u003edq_dqb.dqb_curspace == 0 \u0026\u0026\n+\t dquot-\u003edq_dqb.dqb_curinodes == 0 \u0026\u0026\n+\t dquot-\u003edq_dqb.dqb_bsoftlimit == 0 \u0026\u0026\n+\t dquot-\u003edq_dqb.dqb_isoftlimit == 0 \u0026\u0026\n+\t dquot-\u003edq_dqb.dqb_bhardlimit == bhardlimit \u0026\u0026\n+\t dquot-\u003edq_dqb.dqb_ihardlimit == ihardlimit;\n }\n /*\n- * Store limits from dquot in the tree unless it's fake. If it is fake\n- * remove the id from the tree since there is no useful information in\n- * there.\n+ * Remove the ID from the tree if it has no usage and its limits match\n+ * the mount defaults. Otherwise, save its limits for the next acquire.\n */\n static int shmem_release_dquot(struct dquot *dquot)\n {\n@@ -300,7 +302,7 @@ static int shmem_release_dquot(struct dquot *dquot)\n \treturn -ENOENT;\n \n found:\n-\tif (shmem_is_empty_dquot(dquot)) {\n+\tif (shmem_is_default_dquot(dquot)) {\n \t\t/* Remove entry from the tree */\n \t\trb_erase(\u0026entry-\u003enode, info-\u003edqi_priv);\n \t\tkfree(entry);\n"
} |
| 2/1 | 2026/10/28 17:21 | agent | patch-evaluator |
6mModel:core Args: null Results: {
"EnableConfigs": [
"TMPFS",
"TMPFS_POSIX_ACL",
"TMPFS_QUOTA",
"HUGETLBFS",
"MEMFD_CREATE",
"NUMA"
],
"FocusSymbols": [
"shmem_undo_range",
"shmem_setattr",
"hugetlbfs_setattr",
"shmem_set_acl",
"shmem_writeout",
"shmem_unuse",
"shmem_release_dquot",
"shmem_get_partial_folio",
"shmem_swapin_folio"
],
"Reasoning": "The patch modifies core memory management, tmpfs, hugetlbfs, and shmem quota code. Key changes include enforcing file seals (F_SEAL_EXEC) during chmod and ACL modification in both tmpfs and hugetlbfs (hugetlbfs_setattr, shmem_setattr, shmem_set_acl), handling large folio splitting and swap entry bounds to prevent infinite loops during shmem truncation and hole punching (shmem_undo_range, shmem_get_partial_folio), synchronizing inode eviction with swapout and swapoff using stop_eviction counters (shmem_writeout, shmem_unuse, shmem_evict_inode), and refining default dquot checks in shmem quota management (shmem_release_dquot). All modified paths are directly reachable in virtualized environments via syscalls such as memfd_create, fchmod, fallocate, truncate, setfacl, quotactl, and swapoff.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit e1f9345f3463ab3370b0542f1b4c5e5acb9320bb
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Oct 28 17:21:15 2026 +0000
syz-cluster: applied patch under review
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 01c4d6f44ebe0a..02e0a65d596d86 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -28,6 +28,7 @@
#include <linux/folio_batch.h>
#include <linux/fs_parser.h>
#include <linux/mman.h>
+#include <linux/memfd.h>
#include <linux/slab.h>
#include <linux/dnotify.h>
#include <linux/statfs.h>
@@ -840,6 +841,13 @@ static int hugetlbfs_setattr(const struct mnt_idmap *idmap,
if (error)
return error;
+ if (S_ISREG(inode->i_mode) && (ia_valid & ATTR_MODE)) {
+ error = memfd_check_seals_mode(info->seals, inode->i_mode,
+ attr->ia_mode);
+ if (error)
+ return error;
+ }
+
trace_hugetlbfs_setattr(inode, dentry, attr);
if (ia_valid & ATTR_SIZE) {
diff --git a/include/linux/memfd.h b/include/linux/memfd.h
index c159e40e3f34a0..272479317cf10c 100644
--- a/include/linux/memfd.h
+++ b/include/linux/memfd.h
@@ -2,10 +2,19 @@
#ifndef __LINUX_MEMFD_H
#define __LINUX_MEMFD_H
+#include <linux/fcntl.h>
#include <linux/file.h>
#define MEMFD_ANON_NAME "[memfd]"
+static inline int memfd_check_seals_mode(unsigned int seals, umode_t old_mode,
+ umode_t new_mode)
+{
+ if ((seals & F_SEAL_EXEC) && ((old_mode ^ new_mode) & 0111))
+ return -EPERM;
+ return 0;
+}
+
#ifdef CONFIG_MEMFD_CREATE
extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);
struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0884c629670dd6..4da1cb8777f681 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -3372,11 +3372,11 @@ void __init numa_policy_init(void)
policy_cache = kmem_cache_create("numa_policy",
sizeof(struct mempolicy),
- 0, SLAB_PANIC, NULL);
+ 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);
sn_cache = kmem_cache_create("shared_policy_node",
sizeof(struct sp_node),
- 0, SLAB_PANIC, NULL);
+ 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);
for_each_node(nid) {
preferred_node_policy[nid] = (struct mempolicy) {
diff --git a/mm/shmem.c b/mm/shmem.c
index af21a89abb0f63..9e51768ef46ccb 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -77,6 +77,7 @@ static struct vfsmount *shm_mnt __ro_after_init;
#include <linux/magic.h>
#include <linux/syscalls.h>
#include <linux/fcntl.h>
+#include <linux/memfd.h>
#include <uapi/linux/memfd.h>
#include <linux/rmap.h>
#include <linux/uuid.h>
@@ -1176,12 +1177,11 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap)
}
/*
- * Remove swap entry from page cache, free the swap and its page cache. Returns
- * the number of pages being freed. 0 means entry not found in XArray (0 pages
- * being freed).
+ * Remove a swap entry or swapin-error marker wholly within [index, end].
+ * Return whether it was removed, counting freed swap pages in nr_swaps_freed.
*/
-static long shmem_free_swap(struct address_space *mapping,
- pgoff_t index, pgoff_t end, void *radswap)
+static bool shmem_free_swap(struct address_space *mapping,
+ pgoff_t index, pgoff_t end, void *radswap, long *nr_swaps_freed)
{
XA_STATE(xas, &mapping->i_pages, index);
const softleaf_t swp = radix_to_swp_entry(radswap);
@@ -1202,8 +1202,10 @@ static long shmem_free_swap(struct address_space *mapping,
xas_unlock_irq(&xas);
/* A swapin-error marker holds no swap slot, so just drop it. */
- if (nr_pages && softleaf_is_swap(swp))
+ if (nr_pages && softleaf_is_swap(swp)) {
swap_put_entries_direct(swp, nr_pages);
+ *nr_swaps_freed += nr_pages;
+ }
return nr_pages;
}
@@ -1297,12 +1299,10 @@ void shmem_unlock_mapping(struct address_space *mapping)
static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)
{
+ const gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
struct folio *folio;
- /*
- * At first avoid shmem_get_folio(,,,SGP_READ): that fails
- * beyond i_size, and reports fallocated folios as holes.
- */
+retry:
folio = filemap_get_entry(inode->i_mapping, index);
if (!folio)
return folio;
@@ -1313,13 +1313,14 @@ static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)
/* The folio has been swapped out */
folio_unlock(folio);
folio_put(folio);
+ goto retry;
}
/*
- * But read a folio back from swap if any of it is within i_size
- * (although in some cases this is just a waste of time).
+ * Truncation can look up a large swap entry at or beyond i_size.
+ * Swap it in directly to bypass the size check in shmem_get_folio().
*/
- folio = NULL;
- shmem_get_folio(inode, index, 0, &folio, SGP_READ);
+ if (shmem_swapin_folio(inode, index, &folio, SGP_READ, gfp, NULL, NULL) == -EEXIST)
+ goto retry;
return folio;
}
@@ -1358,8 +1359,8 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
if (xa_is_value(folio)) {
if (unfalloc)
continue;
- nr_swaps_freed += shmem_free_swap(mapping, indices[i],
- end - 1, folio);
+ shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed);
continue;
}
@@ -1422,32 +1423,31 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
if (xa_is_value(folio)) {
int order;
- long swaps_freed;
if (unfalloc)
continue;
- swaps_freed = shmem_free_swap(mapping, indices[i],
- end - 1, folio);
- if (!swaps_freed) {
+ if (!shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed)) {
pgoff_t base = indices[i];
order = shmem_confirm_swap(mapping, indices[i],
radix_to_swp_entry(folio));
/*
- * If found a large swap entry cross the end or start
- * border, skip it as the truncate_inode_partial_folio
- * above should have at least zerod its content once.
+ * Skip boundary entries when restarting
+ * the scan to avoid endless loops after
+ * swapin failure.
*/
if (order > 0) {
base = round_down(base, 1 << order);
- if (base < start || base + (1 << order) > end)
+ if (base < start || base + (1 << order) > end) {
+ start = max(start, base + (1 << order));
continue;
+ }
}
/* Swap was replaced by page or extended, retry */
index = base;
break;
}
- nr_swaps_freed += swaps_freed;
continue;
}
@@ -1463,23 +1463,35 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
VM_BUG_ON_FOLIO(folio_test_writeback(folio),
folio);
- if (!folio_test_large(folio)) {
+ /*
+ * A shared mapping can have dirty PTEs while
+ * the folio is still clean. Mark the folio
+ * dirty so a failed split cannot discard data
+ * outside the range.
+ */
+ if (!unfalloc && folio_test_large(folio))
+ folio_mark_dirty(folio);
+
+ if (unfalloc || !folio_test_large(folio)) {
truncate_inode_folio(mapping, folio);
} else if (truncate_inode_partial_folio(folio,
lstart, lend, NULL, NULL)) {
/*
- * If we split a page, reset the loop so
- * that we pick up the new sub pages.
- * Otherwise the THP was entirely
- * dropped or the target range was
- * zeroed, so just continue the loop as
- * is.
+ * The folio was split. Retry the scan
+ * to find the split folios.
*/
- if (!folio_test_large(folio)) {
- folio_unlock(folio);
- index = start;
- break;
- }
+ folio_unlock(folio);
+ index = start;
+ break;
+ } else if (folio->mapping) {
+ /*
+ * Splitting failed, but the part in the
+ * range is already zeroed. The folio
+ * was not dropped, so skip it when
+ * restarting the scan to avoid retrying
+ * it forever.
+ */
+ start = max(start, folio_next_index(folio));
}
}
folio_unlock(folio);
@@ -1546,10 +1558,11 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
if (error)
return error;
- if ((info->seals & F_SEAL_EXEC) && (attr->ia_valid & ATTR_MODE)) {
- if ((inode->i_mode ^ attr->ia_mode) & 0111) {
- return -EPERM;
- }
+ if (attr->ia_valid & ATTR_MODE) {
+ error = memfd_check_seals_mode(info->seals, inode->i_mode,
+ attr->ia_mode);
+ if (error)
+ return error;
}
if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) {
@@ -1578,7 +1591,8 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
if (oldsize > holebegin)
unmap_mapping_range(inode->i_mapping,
holebegin, 0, 1);
- if (info->alloced)
+ /* Swapin-error markers are not counted in alloced. */
+ if (info->alloced || !mapping_empty(inode->i_mapping))
shmem_truncate_range(inode,
newsize, (loff_t)-1);
/* unmap again to remove racily COWed private pages */
@@ -1614,6 +1628,17 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
return error;
}
+static void shmem_disallow_eviction(struct shmem_inode_info *info)
+{
+ atomic_inc(&info->stop_eviction);
+}
+
+static void shmem_allow_eviction(struct shmem_inode_info *info)
+{
+ if (atomic_dec_and_test(&info->stop_eviction))
+ wake_up_var(&info->stop_eviction);
+}
+
static void shmem_evict_inode(struct inode *inode)
{
struct shmem_inode_info *info = SHMEM_I(inode);
@@ -1626,16 +1651,21 @@ static void shmem_evict_inode(struct inode *inode)
mapping_set_exiting(inode->i_mapping);
shmem_truncate_range(inode, 0, (loff_t)-1);
shmem_unused_huge_del(inode);
- while (!list_empty(&info->swaplist)) {
- /* Wait while shmem_unuse() is scanning this inode... */
+ /*
+ * Writeout may still use the inode after swapoff has removed it
+ * from the swaplist, so always wait at least once.
+ */
+ do {
wait_var_event(&info->stop_eviction,
!atomic_read(&info->stop_eviction));
+ if (list_empty(&info->swaplist))
+ break;
spin_lock(&shmem_swaplist_lock);
/* ...but beware of the race if we peeked too early */
if (!atomic_read(&info->stop_eviction))
list_del_init(&info->swaplist);
spin_unlock(&shmem_swaplist_lock);
- }
+ } while (!list_empty(&info->swaplist));
}
simple_xattrs_free(&sbinfo->xa_cache, &info->xattrs, sbinfo->max_inodes ? &freed : NULL);
@@ -1774,15 +1804,14 @@ int shmem_unuse(unsigned int type)
* remove placeholder inode from swaplist, nor let it be freed
* (igrab() would protect from unlink, but not from unmount).
*/
- atomic_inc(&info->stop_eviction);
+ shmem_disallow_eviction(info);
spin_unlock(&shmem_swaplist_lock);
error = shmem_unuse_inode(&info->vfs_inode, type);
cond_resched();
spin_lock(&shmem_swaplist_lock);
- if (atomic_dec_and_test(&info->stop_eviction))
- wake_up_var(&info->stop_eviction);
+ shmem_allow_eviction(info);
if (error)
break;
if (list_empty(&info->swaplist))
@@ -1913,6 +1942,13 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
spin_unlock(&shmem_swaplist_lock);
}
+ /*
+ * Once the folio has left the page cache, its lock no longer
+ * keeps the inode from being evicted and freed: hold eviction
+ * off, in case the folio has to be put back below.
+ */
+ shmem_disallow_eviction(info);
+
folio_dup_swap(folio, NULL);
shmem_delete_from_page_cache(folio, swp_to_radix_entry(folio->swap));
@@ -1920,6 +1956,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
error = swap_writeout(ctx, folio);
if (error != AOP_WRITEPAGE_ACTIVATE) {
/* folio has been unlocked */
+ shmem_allow_eviction(info);
return error;
}
@@ -1936,6 +1973,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
shmem_recalc_inode(inode, 0, -nr_pages);
folio_put_swap(folio, NULL);
}
+ shmem_allow_eviction(info);
/*
* The swap_cache_del_folio() below could be left for
@@ -2370,11 +2408,10 @@ static void shmem_set_folio_swapin_error(struct inode *inode, pgoff_t index,
folio_put_swap(folio, NULL);
swap_cache_del_folio(folio);
/*
- * Don't treat swapin error folio as alloced. Otherwise inode->i_blocks
- * won't be 0 when inode is released and thus trigger WARN_ON(i_blocks)
- * in shmem_evict_inode().
+ * Let shmem_recalc_inode() reduce alloced and release the block charge
+ * for the freed swap pages.
*/
- shmem_recalc_inode(inode, -nr_pages, -nr_pages);
+ shmem_recalc_inode(inode, 0, -nr_pages);
}
static int shmem_split_large_entry(struct inode *inode, pgoff_t index,
@@ -2515,6 +2552,8 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
else
error = -ENOMEM;
folio = NULL;
+ /* Make sure to validate the original value. */
+ swap = index_entry;
goto failed;
}
if (fault_type) {
@@ -5404,12 +5443,35 @@ static const struct file_operations shmem_file_operations = {
#endif
};
+#ifdef CONFIG_TMPFS_POSIX_ACL
+static int shmem_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
+ struct posix_acl *acl, int type)
+{
+ struct inode *inode = d_inode(dentry);
+ umode_t mode = inode->i_mode;
+ int error;
+
+ if (type == ACL_TYPE_ACCESS) {
+ error = posix_acl_equiv_mode(acl, &mode);
+ if (error < 0)
+ return error;
+ error = memfd_check_seals_mode(SHMEM_I(inode)->seals,
+ inode->i_mode, mode);
+ if (error)
+ return error;
+ }
+ return simple_set_acl(idmap, dentry, acl, type);
+}
+#else
+#define shmem_set_acl NULL
+#endif
+
static const struct inode_operations shmem_inode_operations = {
.getattr = shmem_getattr,
.setattr = shmem_setattr,
#ifdef CONFIG_TMPFS_XATTR
.listxattr = shmem_listxattr,
- .set_acl = simple_set_acl,
+ .set_acl = shmem_set_acl,
.fileattr_get = shmem_fileattr_get,
.fileattr_set = shmem_fileattr_set,
#endif
diff --git a/mm/shmem_quota.c b/mm/shmem_quota.c
index a3fa4bd93e753a..d191ebda3f00e5 100644
--- a/mm/shmem_quota.c
+++ b/mm/shmem_quota.c
@@ -239,7 +239,7 @@ static int shmem_acquire_dquot(struct dquot *dquot)
return ret;
}
-static bool shmem_is_empty_dquot(struct dquot *dquot)
+static bool shmem_is_default_dquot(struct dquot *dquot)
{
struct shmem_sb_info *sbinfo = dquot->dq_sb->s_fs_info;
qsize_t bhardlimit;
@@ -253,19 +253,21 @@ static bool shmem_is_empty_dquot(struct dquot *dquot)
ihardlimit = sbinfo->qlimits.grpquota_ihardlimit;
}
- if (test_bit(DQ_FAKE_B, &dquot->dq_flags) ||
- (dquot->dq_dqb.dqb_curspace == 0 &&
- dquot->dq_dqb.dqb_curinodes == 0 &&
- dquot->dq_dqb.dqb_bhardlimit == bhardlimit &&
- dquot->dq_dqb.dqb_ihardlimit == ihardlimit))
- return true;
-
- return false;
+ /*
+ * Defaults are zero usage and soft limits, and the mount's hard limits.
+ * DQ_FAKE_B only means that *all* limits are zero, which need not match
+ * the mount defaults.
+ */
+ return dquot->dq_dqb.dqb_curspace == 0 &&
+ dquot->dq_dqb.dqb_curinodes == 0 &&
+ dquot->dq_dqb.dqb_bsoftlimit == 0 &&
+ dquot->dq_dqb.dqb_isoftlimit == 0 &&
+ dquot->dq_dqb.dqb_bhardlimit == bhardlimit &&
+ dquot->dq_dqb.dqb_ihardlimit == ihardlimit;
}
/*
- * Store limits from dquot in the tree unless it's fake. If it is fake
- * remove the id from the tree since there is no useful information in
- * there.
+ * Remove the ID from the tree if it has no usage and its limits match
+ * the mount defaults. Otherwise, save its limits for the next acquire.
*/
static int shmem_release_dquot(struct dquot *dquot)
{
@@ -300,7 +302,7 @@ static int shmem_release_dquot(struct dquot *dquot)
return -ENOENT;
found:
- if (shmem_is_empty_dquot(dquot)) {
+ if (shmem_is_default_dquot(dquot)) {
/* Remove entry from the tree */
rb_erase(&entry->node, info->dqi_priv);
kfree(entry);
|
| 3/2 | 2026/10/28 17:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9024 output: 53 thoughts: 988 Thoughts: **Patch Series Evaluation: Worth Fuzzing?** Okay, so I've been tasked with evaluating this patch series. My initial thought is to understand the scope of the changes. It appears this patch series touches several key areas: `fs/hugetlbfs/inode.c`, `include/linux/memfd.h`, `mm/mempolicy.c`, `mm/shmem.c`, and `mm/shmem_quota.c`. My quick analysis reveals the changes relate to memory management, specifically tmpfs, hugetlbfs, and memfd, which immediately flags these as potential areas of interest. The `fs/hugetlbfs/inode.c` modification seems to be integrating `memfd_check_seals_mode` in `hugetlbfs_setattr`. This check also appears in `mm/shmem.c`, along with a range of changes to how shmem handles swap-in/out, eviction prevention, and quota management. There's also some refactoring in `mm/shmem_quota.c` related to dquot handling. `mm/mempolicy.c` looks to be adding `SLAB_ACCOUNT` to policy caches. Given my experience, I can immediately see the significance of this. These components are extremely reachable from userspace via numerous syscalls such as `shmem`, `tmpfs`, `memfd_create`, `truncate`, `fchmod`, `fsetxattr`, `setfacl`, `swapoff`, and `quotactl`. This high user-space interaction makes them prime targets for fuzzing. Standard virtualized environments (QEMU, GCE, syzkaller) will make it easy to reach them. Therefore, the verdict is clear: WorthFuzzing=true. Now, let's nail down the fuzzing strategy. My plan is to focus on specific, non-ubiquitous kernel functions within this patch series. I'll start with these and then broaden from there. Next up, I need to check the required kernel configurations. My initial guess, given the touched files, is that we'll need `HUGETLBFS`, `SHMEM`, `TMPFS`, `TMPFS_POSIX_ACL`, `TMPFS_XATTR`, `TMPFS_QUOTA`, `MEMFD_CREATE`, and `NUMA` enabled. I'll verify this by searching the Kconfig files associated with the modified source files. With these enabled, we should have a solid foundation for effective fuzzing. |
| 4/2 | 2026/10/28 17:21 | tool | grepper |
0mArgs:{
"Expression": "(hugetlbfs|shmem|mempolicy)",
"PathPrefixes": [
"fs/Makefile",
"mm/Makefile",
"fs/hugetlbfs/Makefile"
]
}Results: {
"Output": "fs/Makefile=73=obj-y\t\t\t\t+= ramfs/\nfs/Makefile:74:obj-$(CONFIG_HUGETLBFS)\t\t+= hugetlbfs/\nfs/Makefile-75-obj-$(CONFIG_CODA_FS)\t\t+= coda/\n--\nfs/hugetlbfs/Makefile-5-\nfs/hugetlbfs/Makefile:6:obj-$(CONFIG_HUGETLBFS) += hugetlbfs.o\nfs/hugetlbfs/Makefile-7-\nfs/hugetlbfs/Makefile:8:hugetlbfs-objs := inode.o\n--\nmm/Makefile=51=obj-y\t\t\t:= filemap.o mempool.o oom_kill.o fadvise.o \\\n--\nmm/Makefile-53-\t\t\t readahead.o folio.o truncate.o vmscan.o shrinker.o \\\nmm/Makefile:54:\t\t\t shmem.o util.o mmzone.o vmstat.o backing-dev.o \\\nmm/Makefile-55-\t\t\t mm_init.o percpu.o slab_common.o \\\n--\nmm/Makefile=86=obj-$(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP)\t+= hugetlb_vmemmap.o\nmm/Makefile:87:obj-$(CONFIG_NUMA) \t+= mempolicy.o\nmm/Makefile-88-obj-$(CONFIG_SPARSEMEM)\t+= sparse.o\n--\nmm/Makefile=148=obj-$(CONFIG_EXECMEM) += execmem.o\nmm/Makefile:149:obj-$(CONFIG_TMPFS_QUOTA) += shmem_quota.o\nmm/Makefile-150-obj-$(CONFIG_LAZY_MMU_MODE_KUNIT_TEST) += tests/lazy_mmu_mode_kunit.o\n"
} |
| 5/2 | 2026/10/28 17:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11053 output: 63 thoughts: 40 Thoughts: Here's a summary of my immediate thought process: **Kernel Filesystem Configuration Check** Okay, time to dive into the kernel configuration. I need to quickly assess the status of several key filesystems and memory management options. My immediate focus is on ensuring these are correctly enabled or disabled for the target configuration. I'm going to scan the Kconfig files specifically for TMPFS, SHMEM, HUGETLBFS, then follow up with checking the related features like TMPFS_POSIX_ACL and TMPFS_QUOTA, to ensure they are consistent with the target. Then, I should check the settings for NUMA and MEMFD_CREATE to ensure there are no conflicts or unexpected configurations. Ultimately, the goal is to make sure these elements align to avoid memory issues and system instability. |
| 6/2 | 2026/10/28 17:21 | tool | grepper |
0mArgs:{
"Expression": "config (SHMEM|TMPFS|TMPFS_POSIX_ACL|TMPFS_QUOTA|HUGETLBFS|MEMFD_CREATE)",
"PathPrefixes": [
"mm/Kconfig",
"fs/Kconfig"
]
}Results: {
"Output": "fs/Kconfig=165=source \"fs/sysfs/Kconfig\"\nfs/Kconfig-166-\nfs/Kconfig:167:config TMPFS\nfs/Kconfig-168-\tbool \"Tmpfs virtual memory file system support (former shm fs)\"\n--\nfs/Kconfig-180-\nfs/Kconfig:181:config TMPFS_POSIX_ACL\nfs/Kconfig-182-\tbool \"Tmpfs POSIX Access Control Lists\"\n--\nfs/Kconfig-198-\nfs/Kconfig:199:config TMPFS_XATTR\nfs/Kconfig-200-\tbool \"Tmpfs extended attributes\"\n--\nfs/Kconfig-213-\nfs/Kconfig:214:config TMPFS_INODE64\nfs/Kconfig-215-\tbool \"Use 64-bit ino_t by default in tmpfs\"\n--\nfs/Kconfig-234-\nfs/Kconfig:235:config TMPFS_QUOTA\nfs/Kconfig-236-\tbool \"Tmpfs quota support\"\n--\nfs/Kconfig=247=config ARCH_SUPPORTS_HUGETLBFS\n--\nfs/Kconfig-249-\nfs/Kconfig:250:menuconfig HUGETLBFS\nfs/Kconfig-251-\tbool \"HugeTLB file system support\"\n--\nmm/Kconfig=1329=config KMAP_LOCAL_NON_LINEAR_PTE_ARRAY\n--\nmm/Kconfig-1331-\nmm/Kconfig:1332:config MEMFD_CREATE\nmm/Kconfig-1333-\tbool \"Enable memfd_create() system call\" if EXPERT\n"
} |
| 7/2 | 2026/10/28 17:21 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11752 output: 32 thoughts: 36 Thoughts: Okay, here's my take on those dependencies, summarized as a thought process I might have while working on kernel configuration: **Analyzing Kernel Configuration Dependencies** Alright, time to dig into the Kconfig. I need to get a clear picture of how these filesystem features relate to each other, so I can ensure a sane configuration and avoid any unexpected conflicts or issues down the line. Let's start with `TMPFS_POSIX_ACL`, `TMPFS_QUOTA`, `HUGETLBFS`, `MEMFD_CREATE`, and `NUMA`. I need to ensure they play nicely together, or perhaps even have dependencies or conflicts. I need to double-check their interdependencies. Are any of these required for others to function? Or, are there any that are mutually exclusive? I'll probably need to consider platform architectures, as well. |
| 8/2 | 2026/10/28 17:22 | tool | read-file |
0mArgs:{
"File": "fs/Kconfig",
"FirstLine": 167,
"LineCount": 90
}Results: {
"Contents": " 167:\tconfig TMPFS\n 168:\t\tbool \"Tmpfs virtual memory file system support (former shm fs)\"\n 169:\t\tdepends on SHMEM\n 170:\t\tselect MEMFD_CREATE\n 171:\t\thelp\n 172:\t\t Tmpfs is a file system which keeps all files in virtual memory.\n 173:\t\n 174:\t\t Everything in tmpfs is temporary in the sense that no files will be\n 175:\t\t created on your hard drive. The files live in memory and swap\n 176:\t\t space. If you unmount a tmpfs instance, everything stored therein is\n 177:\t\t lost.\n 178:\t\n 179:\t\t See \u003cfile:Documentation/filesystems/tmpfs.rst\u003e for details.\n 180:\t\n 181:\tconfig TMPFS_POSIX_ACL\n 182:\t\tbool \"Tmpfs POSIX Access Control Lists\"\n 183:\t\tdepends on TMPFS\n 184:\t\tselect TMPFS_XATTR\n 185:\t\tselect FS_POSIX_ACL\n 186:\t\thelp\n 187:\t\t POSIX Access Control Lists (ACLs) support additional access rights\n 188:\t\t for users and groups beyond the standard owner/group/world scheme,\n 189:\t\t and this option selects support for ACLs specifically for tmpfs\n 190:\t\t filesystems.\n 191:\t\n 192:\t\t If you've selected TMPFS, it's possible that you'll also need\n 193:\t\t this option as there are a number of Linux distros that require\n 194:\t\t POSIX ACL support under /dev for certain features to work properly.\n 195:\t\t For example, some distros need this feature for ALSA-related /dev\n 196:\t\t files for sound to work properly. In short, if you're not sure,\n 197:\t\t say Y.\n 198:\t\n 199:\tconfig TMPFS_XATTR\n 200:\t\tbool \"Tmpfs extended attributes\"\n 201:\t\tdepends on TMPFS\n 202:\t\tdefault n\n 203:\t\thelp\n 204:\t\t Extended attributes are name:value pairs associated with inodes by\n 205:\t\t the kernel or by users (see the attr(5) manual page for details).\n 206:\t\n 207:\t\t This enables support for the trusted.*, security.* and user.*\n 208:\t\t namespaces.\n 209:\t\n 210:\t\t You need this for POSIX ACL support on tmpfs.\n 211:\t\n 212:\t\t If unsure, say N.\n 213:\t\n 214:\tconfig TMPFS_INODE64\n 215:\t\tbool \"Use 64-bit ino_t by default in tmpfs\"\n 216:\t\tdepends on TMPFS \u0026\u0026 64BIT\n 217:\t\tdefault n\n 218:\t\thelp\n 219:\t\t tmpfs has historically used only inode numbers as wide as an unsigned\n 220:\t\t int. In some cases this can cause wraparound, potentially resulting\n 221:\t\t in multiple files with the same inode number on a single device. This\n 222:\t\t option makes tmpfs use the full width of ino_t by default, without\n 223:\t\t needing to specify the inode64 option when mounting.\n 224:\t\n 225:\t\t But if a long-lived tmpfs is to be accessed by 32-bit applications so\n 226:\t\t ancient that opening a file larger than 2GiB fails with EINVAL, then\n 227:\t\t the INODE64 config option and inode64 mount option risk operations\n 228:\t\t failing with EOVERFLOW once 33-bit inode numbers are reached.\n 229:\t\n 230:\t\t To override this configured default, use the inode32 or inode64\n 231:\t\t option when mounting.\n 232:\t\n 233:\t\t If unsure, say N.\n 234:\t\n 235:\tconfig TMPFS_QUOTA\n 236:\t\tbool \"Tmpfs quota support\"\n 237:\t\tdepends on TMPFS\n 238:\t\tselect QUOTA\n 239:\t\thelp\n 240:\t\t Quota support allows to set per user and group limits for tmpfs\n 241:\t\t usage. Say Y to enable quota support. Once enabled you can control\n 242:\t\t user and group quota enforcement with quota, usrquota and grpquota\n 243:\t\t mount options.\n 244:\t\n 245:\t\t If unsure, say N.\n 246:\t\n 247:\tconfig ARCH_SUPPORTS_HUGETLBFS\n 248:\t\tdef_bool n\n 249:\t\n 250:\tmenuconfig HUGETLBFS\n 251:\t\tbool \"HugeTLB file system support\"\n 252:\t\tdepends on ARCH_SUPPORTS_HUGETLBFS\n 253:\t\tselect MEMFD_CREATE\n 254:\t\tselect PADATA if SMP\n 255:\t\thelp\n 256:\t\t hugetlbfs is a filesystem backing for HugeTLB pages, based on\n"
} |
| 9/2 | 2026/10/28 17:22 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13357 output: 40 thoughts: 16 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating Shared Memory and NUMA Configuration** Alright, let's dive right in. My first thought is to zero in on how SHMEM and NUMA are configured at the lowest level within the kernel. That naturally leads me to `mm/Kconfig`. It's the go-to place for understanding the core memory management options available during the build process. I want to quickly ascertain the default states, any dependencies on other features, and which options are available for customization related to SHMEM and NUMA support. This initial scan is crucial to form a baseline understanding before I go deeper into the code. Understanding the dependencies is also critical. |
| 10/2 | 2026/10/28 17:22 | tool | grepper |
0mArgs:{
"Expression": "config (SHMEM|NUMA)",
"PathPrefixes": [
"mm/Kconfig",
"init/Kconfig"
]
}Results: {
"Output": "init/Kconfig=815=config ARCH_SUPPORTS_INT128\n--\ninit/Kconfig-817-\ninit/Kconfig:818:config NUMA_BALANCING\ninit/Kconfig-819-\tbool \"Memory placement aware NUMA scheduler\"\n--\ninit/Kconfig=830=config SCHED_CACHE\n--\ninit/Kconfig-840-\ninit/Kconfig:841:config NUMA_BALANCING_DEFAULT_ENABLED\ninit/Kconfig-842-\tbool \"Automatically enable NUMA aware memory/task placement\"\n--\ninit/Kconfig=1739=config EVENTFD\n--\ninit/Kconfig-1747-\ninit/Kconfig:1748:config SHMEM\ninit/Kconfig-1749-\tbool \"Use full shmem filesystem\" if EXPERT\n--\nmm/Kconfig=488=config ARCH_KEEP_MEMBLOCK\n--\nmm/Kconfig-491-# Keep arch NUMA mapping infrastructure post-init.\nmm/Kconfig:492:config NUMA_KEEP_MEMINFO\nmm/Kconfig-493-\tbool\n--\nmm/Kconfig=660=config PAGE_REPORTING\n--\nmm/Kconfig-667-\nmm/Kconfig:668:config NUMA_MIGRATION\nmm/Kconfig-669-\tbool \"NUMA page migration\"\n--\nmm/Kconfig=1431=config EXECMEM\n--\nmm/Kconfig-1433-\nmm/Kconfig:1434:config NUMA_MEMBLKS\nmm/Kconfig-1435-\tbool\nmm/Kconfig-1436-\nmm/Kconfig:1437:config NUMA_EMU\nmm/Kconfig-1438-\tbool \"NUMA emulation\"\n"
} |
| 11/2 | 2026/10/28 17:22 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14025 output: 18 thoughts: 23 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Tracing Down NUMA Configuration** Alright, let's dive into this NUMA situation. My immediate instinct is to pinpoint the definition of `CONFIG_NUMA`. Given the kernel's modular structure, I'm virtually certain we'll find its declaration within the `arch/x86/Kconfig` file. That's the logical place to start, considering the x86 architecture's deep integration with NUMA support. I'm expecting to find the standard `config` directive, along with dependencies and possibly a default value there. From there, I can likely infer the implications and impact of that definition within the broader kernel configuration landscape, as needed. |
| 12/2 | 2026/10/28 17:22 | tool | grepper |
0mArgs:{
"Expression": "config NUMA$"
}Results: {
"Output": "arch/arm64/Kconfig=1668=config HOTPLUG_CPU\n--\narch/arm64/Kconfig-1675-# Common NUMA Features\narch/arm64/Kconfig:1676:config NUMA\narch/arm64/Kconfig-1677-\tbool \"NUMA Memory Allocation and Scheduler Support\"\n--\narch/loongarch/Kconfig=541=config NR_CPUS\n--\narch/loongarch/Kconfig-549-\narch/loongarch/Kconfig:550:config NUMA\narch/loongarch/Kconfig-551-\tbool \"NUMA Support\"\n--\narch/mips/Kconfig=2595=config ARCH_SPARSEMEM_ENABLE\n--\narch/mips/Kconfig-2597-\narch/mips/Kconfig:2598:config NUMA\narch/mips/Kconfig-2599-\tbool \"NUMA Support\"\n--\narch/powerpc/Kconfig=755=config IRQ_ALL_CPUS\n--\narch/powerpc/Kconfig-763-\narch/powerpc/Kconfig:764:config NUMA\narch/powerpc/Kconfig-765-\tbool \"NUMA Memory Allocation and Scheduler Support\"\n--\narch/riscv/Kconfig=479=endchoice\n--\narch/riscv/Kconfig-481-# Common NUMA Features\narch/riscv/Kconfig:482:config NUMA\narch/riscv/Kconfig-483-\tbool \"NUMA Memory Allocation and Scheduler Support\"\n--\narch/s390/Kconfig=545=config HOTPLUG_CPU\n--\narch/s390/Kconfig-547-\narch/s390/Kconfig:548:config NUMA\narch/s390/Kconfig-549-\tbool \"NUMA support\"\n--\narch/sparc/Kconfig=254=config GENERIC_LOCKBREAK\n--\narch/sparc/Kconfig-258-\narch/sparc/Kconfig:259:config NUMA\narch/sparc/Kconfig-260-\tbool \"NUMA support\"\n--\narch/x86/Kconfig=1489=config AMD_MEM_ENCRYPT\n--\narch/x86/Kconfig-1505-# Common NUMA Features\narch/x86/Kconfig:1506:config NUMA\narch/x86/Kconfig-1507-\tbool \"NUMA Memory Allocation and Scheduler Support\"\n"
} |
| 13/2 | 2026/10/28 17:22 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14869 output: 33 thoughts: 909 Thoughts: **Analyzing Patch Changes for Potential Vulnerabilities** Okay, let's break down these patch changes methodically. My goal here is to identify potential targets for fuzzing, focusing on functions that are modified or introduced and could expose vulnerabilities. First, `fs/hugetlbfs/inode.c`: The change in `hugetlbfs_setattr` is immediately interesting. They've added a check using `memfd_check_seals_mode`. `hugetlbfs_setattr` is a static function, but it's called through the `inode_operations` structure. This makes it a valid target, a focus symbol for analysis. I'll need to examine how this seal check interacts with other parts of the system and whether there are any potential bypasses or race conditions. Next, `include/linux/memfd.h`: `memfd_check_seals_mode` itself is static inline. This means it won't have a direct symbol address in the kernel image, and I can't target it directly with coverage-guided fuzzing, at least not in the standard way. I need to keep in mind that the check itself is present, though, and consider its impact. Moving to `mm/mempolicy.c`, the `numa_policy_init` initcall isn't relevant for fuzzing, so I'll skip that. Now, `mm/shmem.c` - This is where things get more involved. There are a bunch of functions here. I need to determine which are valid targets and how to treat the static ones. * `shmem_free_swap`, `shmem_get_partial_folio`, `shmem_undo_range`, `shmem_setattr`, `shmem_disallow_eviction`, `shmem_allow_eviction`, `shmem_evict_inode`, `shmem_set_folio_swapin_error`, and `shmem_swapin_folio` are all static. * `shmem_unuse` and `shmem_writeout` are non-static. * `shmem_set_acl` is static The key question is whether static functions can be targeted. If not inlined, they *should* appear in `/proc/kallsyms` and `vmlinux nm` output, which syzkaller uses. The documentation on how to approach these changes gives me a reminder on how to approach the code. The documentation specifically notes the problems of inlined static functions. I know that if these functions are not inlined, they are in the symbol table. Therefore I am very interested in these static functions. However, If the changes are primarily in static inline helpers, I should identify non-static, feature-specific caller functions in .c files that exercise them. So, for the static functions in `shmem.c`, I need to double-check their symbols and callers. For example, Let's check where `shmem_undo_range` is called to understand its context. |
| 14/2 | 2026/10/28 17:22 | tool | grepper |
0mArgs:{
"Expression": "shmem_undo_range",
"PathPrefixes": [
"mm/shmem.c"
]
}Results: {
"Output": "mm/shmem.c=1300=static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)\n--\nmm/shmem.c-1330- */\nmm/shmem.c:1331:static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\nmm/shmem.c-1332-\t\t\t\t\t\t\t\t bool unfalloc)\n--\nmm/shmem.c=1506=void shmem_truncate_range(struct inode *inode, loff_t lstart, uoff_t lend)\nmm/shmem.c-1507-{\nmm/shmem.c:1508:\tshmem_undo_range(inode, lstart, lend, false);\nmm/shmem.c-1509-\tinode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));\n--\nmm/shmem.c=2880=static int synchronous_wake_function(wait_queue_entry_t *wait,\n--\nmm/shmem.c-2892- * faulting pages into the hole while it's being punched. Although\nmm/shmem.c:2893: * shmem_undo_range() does remove the additions, it may be unable to\nmm/shmem.c-2894- * keep up, as each new page needs its own unmap_mapping_range() call,\n--\nmm/shmem.c=3863=static long shmem_fallocate(struct file *file, int mode, loff_t offset,\n--\nmm/shmem.c-3981-\t\t\tif (index \u003e start) {\nmm/shmem.c:3982:\t\t\t\tshmem_undo_range(inode,\nmm/shmem.c-3983-\t\t\t\t (loff_t)start \u003c\u003c PAGE_SHIFT,\n"
} |
| 15/2 | 2026/10/28 17:22 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16944 output: 33 thoughts: 97 Thoughts: Here's my analysis of the situation: **Investigating the `shmem_undo_range` Function and its Relationship to `shmem_truncate_range`** Okay, I'm looking at `mm/shmem.c` and immediately see that `shmem_undo_range` is a monster of a function – 170 lines! That's a clear indicator it won't be inlined. Makes sense, it's probably doing a lot of heavy lifting. Now, the more interesting bit is `shmem_truncate_range`. It's not static, which means it's exposed outside the module, and it's being called from several key areas: `shmem_setattr`, `shmem_evict_inode`, and, importantly, when using `FALLOC_FL_PUNCH_HOLE` via `shmem_fallocate`. This makes it a critical function for file operations on shmem filesystems, likely responsible for handling the actual truncation of the data. Now, the natural next step is to understand its callers better. I need to figure out the full picture of how `shmem_truncate_range` is being used and what the implications of its operation are. Let's see who is calling that function... |
| 16/2 | 2026/10/28 17:22 | tool | grepper |
0mArgs:{
"Expression": "shmem_truncate_range",
"PathPrefixes": [
"mm/shmem.c"
]
}Results: {
"Output": "mm/shmem.c=1331=static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\n--\nmm/shmem.c-1505-\nmm/shmem.c:1506:void shmem_truncate_range(struct inode *inode, loff_t lstart, uoff_t lend)\nmm/shmem.c-1507-{\n--\nmm/shmem.c-1511-}\nmm/shmem.c:1512:EXPORT_SYMBOL_GPL(shmem_truncate_range);\nmm/shmem.c-1513-\n--\nmm/shmem.c=1548=static int shmem_setattr(const struct mnt_idmap *idmap,\n--\nmm/shmem.c-1595-\t\t\tif (info-\u003ealloced || !mapping_empty(inode-\u003ei_mapping))\nmm/shmem.c:1596:\t\t\t\tshmem_truncate_range(inode,\nmm/shmem.c-1597-\t\t\t\t\t\t\tnewsize, (loff_t)-1);\n--\nmm/shmem.c=1642=static void shmem_evict_inode(struct inode *inode)\n--\nmm/shmem.c-1651-\t\tmapping_set_exiting(inode-\u003ei_mapping);\nmm/shmem.c:1652:\t\tshmem_truncate_range(inode, 0, (loff_t)-1);\nmm/shmem.c-1653-\t\tshmem_unused_huge_del(inode);\n--\nmm/shmem.c=3863=static long shmem_fallocate(struct file *file, int mode, loff_t offset,\n--\nmm/shmem.c-3905-\t\t\t\t\t 1 + unmap_end - unmap_start, 0);\nmm/shmem.c:3906:\t\tshmem_truncate_range(inode, offset, offset + len - 1);\nmm/shmem.c-3907-\t\t/* No need to unmap again: hole-punching leaves COWed pages */\n--\nmm/shmem.c=6048=unsigned long shmem_get_unmapped_area(struct file *file,\n--\nmm/shmem.c-6055-\nmm/shmem.c:6056:void shmem_truncate_range(struct inode *inode, loff_t lstart, uoff_t lend)\nmm/shmem.c-6057-{\n--\nmm/shmem.c-6059-}\nmm/shmem.c:6060:EXPORT_SYMBOL_GPL(shmem_truncate_range);\nmm/shmem.c-6061-\n"
} |
| 17/2 | 2026/10/28 17:22 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18035 output: 36 thoughts: 82 Thoughts: Okay, let's dive into this. **Examining the `shmem_quota.c` Code** Right, let's get down to brass tacks. I need to understand what's changed within the context of this quota system. First, I'm going to zero in on `shmem_quota.c`. The immediate question in my mind is: which functions have been touched? It looks like `shmem_is_default_dquot` and `shmem_release_dquot` are the ones we're interested in here. Now, `shmem_release_dquot`... is it static? That's going to influence how it's used and where it's visible. I'll need to confirm that. Let's pull up the definition of `shmem_release_dquot` in `mm/shmem_quota.c` and take a closer look. I'll need to check the function signature and context within the larger file. |
| 18/2 | 2026/10/28 17:23 | tool | grepper |
0mArgs:{
"Expression": "shmem_release_dquot",
"PathPrefixes": [
"mm/shmem_quota.c"
]
}Results: {
"Output": "mm/shmem_quota.c=242=static bool shmem_is_default_dquot(struct dquot *dquot)\n--\nmm/shmem_quota.c-271- */\nmm/shmem_quota.c:272:static int shmem_release_dquot(struct dquot *dquot)\nmm/shmem_quota.c-273-{\n--\nmm/shmem_quota.c=350=const struct dquot_operations shmem_quota_operations = {\nmm/shmem_quota.c-351-\t.acquire_dquot\t\t= shmem_acquire_dquot,\nmm/shmem_quota.c:352:\t.release_dquot\t\t= shmem_release_dquot,\nmm/shmem_quota.c-353-\t.alloc_dquot\t\t= dquot_alloc,\n"
} |
| 19/2 | 2026/10/28 17:23 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18589 output: 28 thoughts: 233 Thoughts: **Tracing Filesystem Operations** Okay, so I'm digging into these filesystem operations. First, `shmem_release_dquot` - that rings a bell, it's definitely a dquot operation callback. Let's see what else we can uncover. I'm going to check `shmem_set_acl` now. Right, I see it, in `mm/shmem.c`. It's the `shmem_set_acl` function, and it's used as the `.set_acl` function in `shmem_inode_operations`. That makes sense. Now, let's look at `hugetlbfs_setattr`. Ah, found it in `fs/hugetlbfs/inode.c`. It's used as the `.setattr` function in `hugetlbfs_inode_operations`. Alright, got it. Finally, `shmem_setattr`. Same pattern. Found in `mm/shmem.c`, and it is the `.setattr` function in `shmem_inode_operations`. Now, I need to check `shmem_writeout`. Where is it being called? I will check the callers to see where it is being used. |
| 20/2 | 2026/10/28 17:23 | tool | grepper |
0mArgs:{
"Expression": "shmem_writeout",
"PathPrefixes": [
"mm/"
]
}Results: {
"Output": "mm/shmem.c=47=static struct vfsmount *shm_mnt __ro_after_init;\n--\nmm/shmem.c-102-/*\nmm/shmem.c:103: * shmem_fallocate communicates with shmem_fault or shmem_writeout via\nmm/shmem.c-104- * inode-\u003ei_private (with i_rwsem making sure that it has only one user at\n--\nmm/shmem.c=415=static void shmem_free_inode(struct super_block *sb, size_t freed_ispace)\n--\nmm/shmem.c-436- *\nmm/shmem.c:437: * Return: true if swapped was incremented from 0, for shmem_writeout().\nmm/shmem.c-438- */\nmm/shmem.c=439=bool shmem_recalc_inode(struct inode *inode, long alloced, long swapped)\n--\nmm/shmem.c-452-\t * after i_mapping-\u003enrpages has already been adjusted (up or down),\nmm/shmem.c:453:\t * shmem_writeout() has to raise swapped before nrpages is lowered -\nmm/shmem.c-454-\t * to stop a racing shmem_recalc_inode() from thinking that a page has\n--\nmm/shmem.c=1786=int shmem_unuse(unsigned int type)\n--\nmm/shmem.c-1828-/**\nmm/shmem.c:1829: * shmem_writeout - Write the folio to swap\nmm/shmem.c-1830- * @ctx: swap I/O context\n--\nmm/shmem.c-1835- */\nmm/shmem.c:1836:int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\nmm/shmem.c-1837-\t\tstruct list_head *folio_list)\n--\nmm/shmem.c-1981-\t\t * but I'm a little nervous about letting this folio out of\nmm/shmem.c:1982:\t\t * shmem_writeout() in a hybrid half-tmpfs-half-swap state\nmm/shmem.c-1983-\t\t * e.g. folio_mapping(folio) might give an unexpected answer.\n--\nmm/shmem.c=1995=int shmem_write_folio(struct folio *folio)\n--\nmm/shmem.c-1999-\nmm/shmem.c:2000:\terr = shmem_writeout(\u0026ctx, folio, NULL);\nmm/shmem.c-2001-\tswap_write_submit(\u0026ctx);\n--\nmm/shmem.c=3863=static long shmem_fallocate(struct file *file, int mode, loff_t offset,\n--\nmm/shmem.c-3999-\t\t/*\nmm/shmem.c:4000:\t\t * Inform shmem_writeout() how far we have reached.\nmm/shmem.c-4001-\t\t * No need for lock or barrier: we have the page lock.\n--\nmm/swap.h=467=extern const struct swap_ops swap_bdev_ops;\nmm/swap.h-468-\nmm/swap.h:469:int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\nmm/swap.h-470-\t\tstruct list_head *folio_list);\n--\nmm/swapfile.c=2835=static int try_to_unuse(unsigned int type)\n--\nmm/swapfile.c-2917-\t * exit_mmap(), which proceeds at its own independent pace;\nmm/swapfile.c:2918:\t * and even shmem_writeout() could have been preempted after\nmm/swapfile.c-2919-\t * folio_alloc_swap(), temporarily hiding that swap. It's easy\n--\nmm/vmscan.c=693=static pageout_t pageout(struct swap_io_ctx *ctx, struct address_space *mapping,\n--\nmm/vmscan.c-729-\tif (shmem_mapping(mapping))\nmm/vmscan.c:730:\t\tres = shmem_writeout(ctx, folio, folio_list);\nmm/vmscan.c-731-\telse\n"
} |
| 21/2 | 2026/10/28 17:23 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20229 output: 28 thoughts: 41 Thoughts: Here's my summary, as though I'm thinking through this myself: **Tracing Shared Memory Pageout and Unuse** Okay, so I'm digging into the shared memory (shmem) pageout process. It seems that `shmem_writeout` gets invoked during `vmscan`, specifically when swapping out shmem pages. That makes perfect sense; `shmem_writeout` is the logical function to handle the physical write to disk for those shared memory pages being evicted. Now, the other piece of the puzzle is `shmem_unuse`. I need to figure out the calling contexts for that function. It's crucial to understand *when* and *why* those shared memory pages are deemed no longer actively in use and need to be cleaned up. Is it tied to a process detaching from the shmem segment? Or is there another trigger? I need to track down the call sites of `shmem_unuse` to fully map the lifecycle of these shmem pages during swapping. I need to get a handle on all scenarios. |
| 22/2 | 2026/10/28 17:23 | tool | grepper |
0mArgs:{
"Expression": "shmem_unuse",
"PathPrefixes": [
"mm/"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 233 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (3 files in total):\nmm/filemap.c:1\nmm/shmem.c:53\nmm/swapfile.c:1\n\nmm/filemap.c=4636=static void filemap_cachestat(struct address_space *mapping,\n--\nmm/filemap.c-4695-\t\t\t\t * inode means we beat\nmm/filemap.c:4696:\t\t\t\t * shmem_unuse(). rcu_read_lock()\nmm/filemap.c-4697-\t\t\t\t * ensures swapoff waits for us before\n--\nmm/shmem.c=707=static const char *shmem_format_huge(int huge)\n--\nmm/shmem.c-728-\nmm/shmem.c:729:static bool is_shmem_unused_huge_isolated(struct shmem_inode_info *info)\nmm/shmem.c-730-{\n--\nmm/shmem.c-734-\nmm/shmem.c:735:static void set_shmem_unused_huge_isolated(struct shmem_inode_info *info)\nmm/shmem.c-736-{\n--\nmm/shmem.c=750=static struct obj_cgroup *\nmm/shmem.c:751:shmem_unused_huge_alloc_lru(struct shmem_sb_info *sbinfo, struct folio *folio,\nmm/shmem.c-752-\t\t\t gfp_t gfp)\n--\nmm/shmem.c=763=static struct obj_cgroup *\nmm/shmem.c:764:shmem_unused_huge_alloc_lru(struct shmem_sb_info *sbinfo, struct folio *folio,\nmm/shmem.c-765-\t\t\t gfp_t gfp)\n--\nmm/shmem.c-770-\nmm/shmem.c:771:static void shmem_unused_huge_lru_add(struct shmem_sb_info *sbinfo,\nmm/shmem.c-772-\t\t\t\t struct list_head *item, int nid,\n--\nmm/shmem.c-782-\nmm/shmem.c:783:static void shmem_unused_huge_lru_del(struct shmem_sb_info *sbinfo,\nmm/shmem.c-784-\t\t\t\t struct list_head *item, int nid,\n--\nmm/shmem.c-794-\nmm/shmem.c:795:static void shmem_unused_huge_add(struct inode *inode, struct folio *folio,\nmm/shmem.c-796-\t\t\t\t gfp_t gfp)\n--\nmm/shmem.c-802-\nmm/shmem.c:803:\tobjcg = shmem_unused_huge_alloc_lru(sbinfo, folio, gfp);\nmm/shmem.c-804-\tif (IS_ERR(objcg))\n--\nmm/shmem.c-809-\t\t/* isolated on scan list, let shrink handle it */\nmm/shmem.c:810:\t\tif (is_shmem_unused_huge_isolated(info))\nmm/shmem.c-811-\t\t\tgoto unlock;\n--\nmm/shmem.c-816-\nmm/shmem.c:817:\t\tshmem_unused_huge_lru_del(sbinfo, \u0026info-\u003eshrinklist,\nmm/shmem.c-818-\t\t\t\t\t info-\u003eshrinklist_nid,\n--\nmm/shmem.c-824-\tinfo-\u003eshrinklist_nid = nid;\nmm/shmem.c:825:\tshmem_unused_huge_lru_add(sbinfo, \u0026info-\u003eshrinklist, nid, objcg);\nmm/shmem.c-826-\tobjcg = NULL;\n--\nmm/shmem.c-832-\nmm/shmem.c:833:static void shmem_unused_huge_del(struct inode *inode)\nmm/shmem.c-834-{\n--\nmm/shmem.c-840-\tif (!list_empty(\u0026info-\u003eshrinklist)) {\nmm/shmem.c:841:\t\tshmem_unused_huge_lru_del(sbinfo, \u0026info-\u003eshrinklist,\nmm/shmem.c-842-\t\t\t\t\t info-\u003eshrinklist_nid,\n--\nmm/shmem.c-850-\nmm/shmem.c:851:struct shmem_unused_huge_scan {\nmm/shmem.c-852-\tstruct list_head list;\n--\nmm/shmem.c-855-\nmm/shmem.c:856:static enum lru_status shmem_unused_huge_isolate(struct list_head *item,\nmm/shmem.c-857-\t\t\t\t\t\t struct list_lru_one *lru,\n--\nmm/shmem.c-859-{\nmm/shmem.c:860:\tstruct shmem_unused_huge_scan *scan = arg;\nmm/shmem.c-861-\tstruct shmem_inode_info *info;\n--\nmm/shmem.c-886-\tobjcg = shmem_get_and_clear_objcg(info);\nmm/shmem.c:887:\tset_shmem_unused_huge_isolated(info);\nmm/shmem.c-888-\tlist_add_tail(\u0026info-\u003eshrinklist, \u0026scan-\u003elist);\n--\nmm/shmem.c-894-\nmm/shmem.c:895:static bool is_shmem_unused_huge_match(struct folio *folio,\nmm/shmem.c-896-\t\t\t\t struct shrink_control *sc)\n--\nmm/shmem.c-922-\nmm/shmem.c:923:static void shmem_unused_huge_drop(struct inode *inode)\nmm/shmem.c-924-{\n--\nmm/shmem.c-931-\nmm/shmem.c:932:static void shmem_unused_huge_requeue(struct inode *inode, struct folio *folio)\nmm/shmem.c-933-{\n--\nmm/shmem.c-938-\nmm/shmem.c:939:\tobjcg = shmem_unused_huge_alloc_lru(sbinfo, folio, GFP_NOWAIT);\nmm/shmem.c-940-\tif (IS_ERR(objcg)) {\nmm/shmem.c:941:\t\tshmem_unused_huge_drop(inode);\nmm/shmem.c-942-\t\treturn;\n--\nmm/shmem.c-947-\tlist_del_init(\u0026info-\u003eshrinklist);\nmm/shmem.c:948:\tshmem_unused_huge_lru_add(sbinfo, \u0026info-\u003eshrinklist, nid, objcg);\nmm/shmem.c-949-\tinfo-\u003eshrinklist_objcg = objcg;\n--\nmm/shmem.c-953-\nmm/shmem.c:954:static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,\nmm/shmem.c-955-\t\tstruct shrink_control *sc, unsigned long nr_to_free)\nmm/shmem.c-956-{\nmm/shmem.c:957:\tstruct shmem_unused_huge_scan scan;\nmm/shmem.c-958-\tstruct inode *inode;\n--\nmm/shmem.c-967-\t\tlist_lru_shrink_walk(\u0026sbinfo-\u003eshrinklist, sc,\nmm/shmem.c:968:\t\t\t\t shmem_unused_huge_isolate, \u0026scan);\nmm/shmem.c-969-\telse\nmm/shmem.c:970:\t\tlist_lru_walk(\u0026sbinfo-\u003eshrinklist, shmem_unused_huge_isolate,\nmm/shmem.c-971-\t\t\t \u0026scan, 128);\n--\nmm/shmem.c-999-\nmm/shmem.c:1000:\t\tif (!is_shmem_unused_huge_match(folio, scan.sc))\nmm/shmem.c-1001-\t\t\tgoto move_back;\n--\nmm/shmem.c-1015-\nmm/shmem.c:1016:\t\tif (!is_shmem_unused_huge_match(folio, scan.sc)) {\nmm/shmem.c-1017-\t\t\tfolio_unlock(folio);\n--\nmm/shmem.c-1031-drop:\nmm/shmem.c:1032:\t\tshmem_unused_huge_drop(inode);\nmm/shmem.c-1033-\t\tgoto put;\nmm/shmem.c-1034-move_back:\nmm/shmem.c:1035:\t\tshmem_unused_huge_requeue(inode, folio);\nmm/shmem.c-1036-\t\tfolio_put(folio);\n--\nmm/shmem.c-1043-\nmm/shmem.c:1044:static long shmem_unused_huge_scan(struct super_block *sb,\nmm/shmem.c-1045-\t\tstruct shrink_control *sc)\n--\nmm/shmem.c-1051-\nmm/shmem.c:1052:\treturn shmem_unused_huge_shrink(sbinfo, sc, 0);\nmm/shmem.c-1053-}\nmm/shmem.c-1054-\nmm/shmem.c:1055:static long shmem_unused_huge_count(struct super_block *sb,\nmm/shmem.c-1056-\t\tstruct shrink_control *sc)\n--\nmm/shmem.c-1065-\nmm/shmem.c:1066:static void shmem_unused_huge_add(struct inode *inode, struct folio *folio,\nmm/shmem.c-1067-\t\t\t\t gfp_t gfp)\n--\nmm/shmem.c-1070-\nmm/shmem.c:1071:static void shmem_unused_huge_del(struct inode *inode)\nmm/shmem.c-1072-{\n--\nmm/shmem.c-1074-\nmm/shmem.c:1075:static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,\nmm/shmem.c-1076-\t\tstruct shrink_control *sc, unsigned long nr_to_free)\n--\nmm/shmem.c=1642=static void shmem_evict_inode(struct inode *inode)\n--\nmm/shmem.c-1652-\t\tshmem_truncate_range(inode, 0, (loff_t)-1);\nmm/shmem.c:1653:\t\tshmem_unused_huge_del(inode);\nmm/shmem.c-1654-\t\t/*\n--\nmm/shmem.c=1685=static unsigned int shmem_find_swap_entries(struct address_space *mapping,\n--\nmm/shmem.c-1726- */\nmm/shmem.c:1727:static int shmem_unuse_swap_entries(struct inode *inode,\nmm/shmem.c-1728-\t\tstruct folio_batch *fbatch, pgoff_t *indices)\n--\nmm/shmem.c-1754- */\nmm/shmem.c:1755:static int shmem_unuse_inode(struct inode *inode, unsigned int type)\nmm/shmem.c-1756-{\n--\nmm/shmem.c-1770-\nmm/shmem.c:1771:\t\tret = shmem_unuse_swap_entries(inode, \u0026fbatch, indices);\nmm/shmem.c-1772-\t\tif (ret \u003c 0)\n--\nmm/shmem.c-1785- */\nmm/shmem.c:1786:int shmem_unuse(unsigned int type)\nmm/shmem.c-1787-{\n--\nmm/shmem.c-1809-\nmm/shmem.c:1810:\t\terror = shmem_unuse_inode(\u0026info-\u003evfs_inode, type);\nmm/shmem.c-1811-\t\tcond_resched();\n--\nmm/shmem.c=1836=int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,\n--\nmm/shmem.c-1930-\t\t/*\nmm/shmem.c:1931:\t\t * Add inode to shmem_unuse()'s list of swapped-out inodes,\nmm/shmem.c-1932-\t\t * if it's not already there. Do it now before the folio is\n--\nmm/shmem.c-1934-\t\t * protects the inode from eviction. And do it now, after\nmm/shmem.c:1935:\t\t * we've incremented swapped, because shmem_unuse() will\nmm/shmem.c-1936-\t\t * prune a !swapped inode from the swaplist.\n--\nmm/shmem.c=2181=static struct folio *shmem_alloc_and_add_folio(struct vm_fault *vmf,\n--\nmm/shmem.c-2254-\t\t */\nmm/shmem.c:2255:\t\tshmem_unused_huge_shrink(sbinfo, NULL, pages);\nmm/shmem.c-2256-\t\t/*\n--\nmm/shmem.c=2285=static struct folio *shmem_swap_alloc_folio(struct inode *inode,\n--\nmm/shmem.c-2316- * usual swapin of shmem_get_folio_gfp(), or by the less common swapoff of\nmm/shmem.c:2317: * shmem_unuse_inode()), it may have been read in earlier from swap, in\nmm/shmem.c-2318- * ignorance of the mapping it belongs to. If that mapping has special\n--\nmm/shmem.c=2671=static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,\n\n"
} |
| 23/2 | 2026/10/28 17:23 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24185 output: 31 thoughts: 2453 Thoughts: **Fuzzing Target Identification: A Deep Dive into shmem/hugetlbfs Code** Okay, so `shmem_unuse` is definitely called during `swapoff` from `swapfile.c`, which is a key starting point. This patch series looks like a significant set of fixes and refinements in `shmem` and `hugetlbfs` and it’s important to understand the changes. Let's see... First, we've got `hugetlbfs_setattr` getting a seal check added via `memfd_check_seals_mode`. This is related to the `F_SEAL_EXEC` seal enforcement. It checks executable permissions and calls `memfd_check_seals_mode`. I remember, that this function checks for `F_SEAL_EXEC` and handles changes to executable permissions (0111). Also, in `mm/mempolicy.c`, `numa_policy_init` now adds `SLAB_ACCOUNT` to `policy_cache` and `sn_cache`. In `mm/shmem.c`: `shmem_free_swap` now has a changed return type and counts freed swap pages. And the handling of swapin-error markers is added to this. `shmem_get_partial_folio` is changed to retry swap out and also returns -EEXIST from `shmem_swapin_folio`, directly swaps in folio at or beyond i_size. `shmem_undo_range` calls `shmem_free_swap`, handles boundary entries, marks large clean folios in shared mappings as dirty before split. If the split failed, the code skips the folio if it's still in the mapping. We're seeing changes to prevent infinite loops in those operations. Also, `shmem_setattr` uses `memfd_check_seals_mode` for mode attributes, triggering `shmem_truncate_range` if `!mapping_empty(inode->i_mapping)`, even with swapin errors, good catch! `shmem_disallow_eviction` and `shmem_allow_eviction` are in place for atomic refcounting for `info->stop_eviction`. The wait loop in `shmem_evict_inode` is changed to handle potential writeout/swapoff races. `shmem_unuse`, along with `shmem_writeout`, uses these `shmem_disallow_eviction` and `shmem_allow_eviction` functions too. We've got `shmem_set_folio_swapin_error` that now calls `shmem_recalc_inode`, and `shmem_swapin_folio` validates original values. Finally, `shmem_set_acl` checks `memfd_check_seals_mode` before calling `simple_set_acl`. `shmem_release_dquot` now calls `shmem_is_default_dquot`, and this helper now checks default quota limits correctly, rather than the previous incorrect check. This patch series is definitely fixing potential vulnerabilities: `F_SEAL_EXEC` enforcement on `chmod`, avoiding infinite loops in the truncation logic, handling a race between eviction and writeout, swapin error accounting and the quota check. Okay, these changes are all in core memory management and related to tmpfs/hugetlbfs. They're accessible from userspace system calls, which means we *absolutely* should fuzz them. Definitely `WorthFuzzing = true`. Now, we need to choose our focus symbols carefully. We need to avoid ubiquitous lifecycle hot-paths, and instead focus on entrypoints and features specific to the changes. Here's the list of candidate focus symbols from the modified code: From `fs/hugetlbfs/inode.c`: * `hugetlbfs_setattr` From `mm/shmem.c`: * `shmem_undo_range` * `shmem_get_partial_folio` * `shmem_free_swap` * `shmem_setattr` * `shmem_set_acl` * `shmem_evict_inode` * `shmem_writeout` * `shmem_unuse` * `shmem_set_folio_swapin_error` * `shmem_swapin_folio` From `mm/shmem_quota.c`: * `shmem_release_dquot` * `shmem_is_default_dquot` After checking all the symbols, none are ubiquitous. Some are more specific than others. We need the right focus. Let’s be precise on the chosen ` |
| 24/2 | 2026/10/28 17:24 | tool | grepper |
0mError:no matches Args: {
"Expression": "CONFIG_SWAP",
"PathPrefixes": [
"mm/shmem.c"
]
}Results: {
"error": "no matches"
} |
| 25/2 | 2026/10/28 17:24 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27708 output: 41 thoughts: 32 Thoughts: Okay, let's dive into this. Here's how I'd approach that kernel code: **Checking Swap Usage in Shared Memory** Right, I need to see how `CONFIG_SWAP` plays a role in shared memory management. My initial instinct is to look at `mm/shmem.c` and potentially also `include/linux/swap.h`. That's where I'd expect to find the core implementations and definitions related to shared memory and swapping. I'm assuming that if swapping is enabled, it *has* to affect shared memory, otherwise there is no point of the configuration macro. The question is: how directly? Is it a compile-time conditional, or a more runtime-dependent thing? I'll be looking for any uses of `#ifdef CONFIG_SWAP`, or any conditional logic or function calls that incorporate that configuration option. I'll need to figure out the exact mechanisms and data structures affected by this configuration. Hopefully the code is well-commented. I'll probably start with a grep to find all the instances of CONFIG_SWAP and narrow down from there. From there I can determine how the presence of the macro changes the behavior, if at all. |
| 26/2 | 2026/10/28 17:24 | tool | grepper |
0mArgs:{
"Expression": "(shmem_writeout|shmem_unuse)",
"PathPrefixes": [
"mm/",
"include/"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 291 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (6 files in total):\ninclude/linux/shmem_fs.h:1\nmm/filemap.c:1\nmm/shmem.c:61\nmm/swap.h:1\nmm/swapfile.c:2\nmm/vmscan.c:1\n\ninclude/linux/shmem_fs.h=131=void shmem_truncate_range(struct inode *inode, loff_t start, uoff_t end);\ninclude/linux/shmem_fs.h:132:int shmem_unuse(unsigned int type);\ninclude/linux/shmem_fs.h-133-\n--\nmm/filemap.c=4636=static void filemap_cachestat(struct address_space *mapping,\n--\nmm/filemap.c-4695-\t\t\t\t * inode means we beat\nmm/filemap.c:4696:\t\t\t\t * shmem_unuse(). rcu_read_lock()\nmm/filemap.c-4697-\t\t\t\t * ensures swapoff waits for us before\n--\nmm/shmem.c=47=static struct vfsmount *shm_mnt __ro_after_init;\n--\nmm/shmem.c-102-/*\nmm/shmem.c:103: * shmem_fallocate communicates with shmem_fault or shmem_writeout via\nmm/shmem.c-104- * inode-\u003ei_private (with i_rwsem making sure that it has only one user at\n--\nmm/shmem.c=415=static void shmem_free_inode(struct super_block *sb, size_t freed_ispace)\n--\nmm/shmem.c-436- *\nmm/shmem.c:437: * Return: true if swapped was incremented from 0, for shmem_writeout().\nmm/shmem.c-438- */\nmm/shmem.c=439=bool shmem_recalc_inode(struct inode *inode, long alloced, long swapped)\n--\nmm/shmem.c-452-\t * after i_mapping-\u003enrpages has already been adjusted (up or down),\nmm/shmem.c:453:\t * shmem_writeout() has to raise swapped before nrpages is lowered -\nmm/shmem.c-454-\t * to stop a racing shmem_recalc_inode() from thinking that a page has\n--\nmm/shmem.c=707=static const char *shmem_format_huge(int huge)\n--\nmm/shmem.c-728-\nmm/shmem.c:729:static bool is_shmem_unused_huge_isolated(struct shmem_inode_info *info)\nmm/shmem.c-730-{\n--\nmm/shmem.c-734-\nmm/shmem.c:735:static void set_shmem_unused_huge_isolated(struct shmem_inode_info *info)\nmm/shmem.c-736-{\n--\nmm/shmem.c=750=static struct obj_cgroup *\nmm/shmem.c:751:shmem_unused_huge_alloc_lru(struct shmem_sb_info *sbinfo, struct folio *folio,\nmm/shmem.c-752-\t\t\t gfp_t gfp)\n--\nmm/shmem.c=763=static struct obj_cgroup *\nmm/shmem.c:764:shmem_unused_huge_alloc_lru(struct shmem_sb_info *sbinfo, struct folio *folio,\nmm/shmem.c-765-\t\t\t gfp_t gfp)\n--\nmm/shmem.c-770-\nmm/shmem.c:771:static void shmem_unused_huge_lru_add(struct shmem_sb_info *sbinfo,\nmm/shmem.c-772-\t\t\t\t struct list_head *item, int nid,\n--\nmm/shmem.c-782-\nmm/shmem.c:783:static void shmem_unused_huge_lru_del(struct shmem_sb_info *sbinfo,\nmm/shmem.c-784-\t\t\t\t struct list_head *item, int nid,\n--\nmm/shmem.c-794-\nmm/shmem.c:795:static void shmem_unused_huge_add(struct inode *inode, struct folio *folio,\nmm/shmem.c-796-\t\t\t\t gfp_t gfp)\n--\nmm/shmem.c-802-\nmm/shmem.c:803:\tobjcg = shmem_unused_huge_alloc_lru(sbinfo, folio, gfp);\nmm/shmem.c-804-\tif (IS_ERR(objcg))\n--\nmm/shmem.c-809-\t\t/* isolated on scan list, let shrink handle it */\nmm/shmem.c:810:\t\tif (is_shmem_unused_huge_isolated(info))\nmm/shmem.c-811-\t\t\tgoto unlock;\n--\nmm/shmem.c-816-\nmm/shmem.c:817:\t\tshmem_unused_huge_lru_del(sbinfo, \u0026info-\u003eshrinklist,\nmm/shmem.c-818-\t\t\t\t\t info-\u003eshrinklist_nid,\n--\nmm/shmem.c-824-\tinfo-\u003eshrinklist_nid = nid;\nmm/shmem.c:825:\tshmem_unused_huge_lru_add(sbinfo, \u0026info-\u003eshrinklist, nid, objcg);\nmm/shmem.c-826-\tobjcg = NULL;\n--\nmm/shmem.c-832-\nmm/shmem.c:833:static void shmem_unused_huge_del(struct inode *inode)\nmm/shmem.c-834-{\n--\nmm/shmem.c-840-\tif (!list_empty(\u0026info-\u003eshrinklist)) {\nmm/shmem.c:841:\t\tshmem_unused_huge_lru_del(sbinfo, \u0026info-\u003eshrinklist,\nmm/shmem.c-842-\t\t\t\t\t info-\u003eshrinklist_nid,\n--\nmm/shmem.c-850-\nmm/shmem.c:851:struct shmem_unused_huge_scan {\nmm/shmem.c-852-\tstruct list_head list;\n--\nmm/shmem.c-855-\nmm/shmem.c:856:static enum lru_status shmem_unused_huge_isolate(struct list_head *item,\nmm/shmem.c-857-\t\t\t\t\t\t struct list_lru_one *lru,\n--\nmm/shmem.c-859-{\nmm/shmem.c:860:\tstruct shmem_unused_huge_scan *scan = arg;\nmm/shmem.c-861-\tstruct shmem_inode_info *info;\n--\nmm/shmem.c-886-\tobjcg = shmem_get_and_clear_objcg(info);\nmm/shmem.c:887:\tset_shmem_unused_huge_isolated(info);\nmm/shmem.c-888-\tlist_add_tail(\u0026info-\u003eshrinklist, \u0026scan-\u003elist);\n--\nmm/shmem.c-894-\nmm/shmem.c:895:static bool is_shmem_unused_huge_match(struct folio *folio,\nmm/shmem.c-896-\t\t\t\t struct shrink_control *sc)\n--\nmm/shmem.c-922-\nmm/shmem.c:923:static void shmem_unused_huge_drop(struct inode *inode)\nmm/shmem.c-924-{\n--\nmm/shmem.c-931-\nmm/shmem.c:932:static void shmem_unused_huge_requeue(struct inode *inode, struct folio *folio)\nmm/shmem.c-933-{\n--\nmm/shmem.c-938-\nmm/shmem.c:939:\tobjcg = shmem_unused_huge_alloc_lru(sbinfo, folio, GFP_NOWAIT);\nmm/shmem.c-940-\tif (IS_ERR(objcg)) {\nmm/shmem.c:941:\t\tshmem_unused_huge_drop(inode);\nmm/shmem.c-942-\t\treturn;\n--\nmm/shmem.c-947-\tlist_del_init(\u0026info-\u003eshrinklist);\nmm/shmem.c:948:\tshmem_unused_huge_lru_add(sbinfo, \u0026info-\u003eshrinklist, nid, objcg);\nmm/shmem.c-949-\tinfo-\u003eshrinklist_objcg = objcg;\n--\nmm/shmem.c-953-\nmm/shmem.c:954:static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,\nmm/shmem.c-955-\t\tstruct shrink_control *sc, unsigned long nr_to_free)\nmm/shmem.c-956-{\nmm/shmem.c:957:\tstruct shmem_unused_huge_scan scan;\nmm/shmem.c-958-\tstruct inode *inode;\n--\nmm/shmem.c-967-\t\tlist_lru_shrink_walk(\u0026sbinfo-\u003eshrinklist, sc,\nmm/shmem.c:968:\t\t\t\t shmem_unused_huge_isolate, \u0026scan);\nmm/shmem.c-969-\telse\nmm/shmem.c:970:\t\tlist_lru_walk(\u0026sbinfo-\u003eshrinklist, shmem_unused_huge_isolate,\nmm/shmem.c-971-\t\t\t \u0026scan, 128);\n--\nmm/shmem.c-999-\nmm/shmem.c:1000:\t\tif (!is_shmem_unused_huge_match(folio, scan.sc))\nmm/shmem.c-1001-\t\t\tgoto move_back;\n--\nmm/shmem.c-1015-\nmm/shmem.c:1016:\t\tif (!is_shmem_unused_huge_match(folio, scan.sc)) {\nmm/shmem.c-1017-\t\t\tfolio_unlock(folio);\n--\nmm/shmem.c-1031-drop:\nmm/shmem.c:1032:\t\tshmem_unused_huge_drop(inode);\nmm/shmem.c-1033-\t\tgoto put;\nmm/shmem.c-1034-move_back:\nmm/shmem.c:1035:\t\tshmem_unused_huge_requeue(inode, folio);\nmm/shmem.c-1036-\t\tfolio_put(folio);\n--\nmm/shmem.c-1043-\nmm/shmem.c:1044:static long shmem_unused_huge_scan(struct super_block *sb,\nmm/shmem.c-1045-\t\tstruct shrink_control *sc)\n--\nmm/shmem.c-1051-\nmm/shmem.c:1052:\treturn shmem_unused_huge_shrink(sbinfo, sc, 0);\nmm/shmem.c-1053-}\nmm/shmem.c-1054-\nmm/shmem.c:1055:static long shmem_unused_huge_count(struct super_block *sb,\nmm/shmem.c-1056-\t\tstruct shrink_control *sc)\n--\nmm/shmem.c-1065-\nmm/shmem.c:1066:static void shmem_unused_huge_add(struct inode *inode, struct folio *folio,\nmm/shmem.c-1067-\t\t\t\t gfp_t gfp)\n--\nmm/shmem.c-1070-\nmm/shmem.c:1071:static void shmem_unused_huge_del(struct inode *inode)\nmm/shmem.c-1072-{\n--\nmm/shmem.c-1074-\nmm/shmem.c:1075:static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,\nmm/shmem.c-1076-\t\tstruct shrink_control *sc, unsigned long nr_to_free)\n--\nmm/shmem.c=1642=static void shmem_evict_inode(struct inode *inode)\n--\nmm/shmem.c-1652-\t\tshmem_truncate_range(inode, 0, (loff_t)-1);\nmm/shmem.c:1653:\t\tshmem_unused_huge_del(inode);\nmm/shmem.c-1654-\t\t/*\n--\nmm/shmem.c=1685=static unsigned int shmem_find_swap_entries(struct address_space *mapping,\n--\nmm/shmem.c-1726- */\nmm/shmem.c:1727:static int shmem_unuse_swap_entries(struct inode *inode,\nmm/shmem.c-1728-\t\tstruct folio_batch *fbatch, pgoff_t *indices)\n--\nmm/shmem.c-1754- */\nmm/shmem.c:1755:static int shmem_unuse_inode(struct inode *inode, unsigned int type)\nmm/shmem.c-1756-{\n--\nmm/shmem.c-1770-\nmm/shmem.c:1771:\t\tret = shmem_unuse_swap_entries(inode, \u0026fbatch, indices);\nmm/shmem.c-1772-\t\tif (ret \u003c 0)\n--\nmm/shmem.c-1785- */\nmm/shmem.c:1786:int shmem_unuse(unsigned int type)\nmm/shmem.c-1787-{\n--\nmm/shmem.c-1809-\nmm/shmem.c:1810:\t\terror = shmem_unuse_inode(\u0026info-\u003evfs_inode, type);\nmm/shmem.c-1811-\t\tcond_resched();\n--\nmm/shmem.c-1828-/**\nmm/shmem.c:1829: * shmem_writeout - Write the folio to swap\n\n"
} |
| 27/2 | 2026/10/28 17:24 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31716 output: 29 thoughts: 17 Thoughts: Here's my thought process, as if I were considering this myself: **Investigating Swap Configuration in the Kernel** Okay, so I need to understand how the `CONFIG_SWAP` option is defined within the kernel's build system. This usually means digging into `mm/Kconfig`, right? That's where all the memory management related configurations live. I need to figure out exactly what conditions enable or disable swap support. Is it dependent on the architecture? Specific hardware features? Maybe another option's setting? I'll need to carefully read through that section of the Kconfig file, paying close attention to dependencies and default values. I'm looking for the precise logic that governs whether or not the swap functionality is compiled into the kernel. It's important to understand the build-time configuration to fully grasp how this feature is handled. This is likely a key indicator of its availability at runtime. |
| 28/2 | 2026/10/28 17:25 | tool | grepper |
0mArgs:{
"Expression": "config SWAP$",
"PathPrefixes": [
"mm/Kconfig"
]
}Results: {
"Output": "mm/Kconfig=9=config ARCH_NO_SWAP\n--\nmm/Kconfig-11-\nmm/Kconfig:12:menuconfig SWAP\nmm/Kconfig-13-\tbool \"Support for paging of anonymous memory (swap)\"\n"
} |
| 29/2 | 2026/10/28 17:25 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 32023 output: 38 thoughts: 40 Thoughts: Okay, let's dive into this. Here's my thought process on examining the dependency between shared memory (`CONFIG_SHMEM`) and swap functionality: **Assessing the CONFIG_SHMEM and CONFIG_SWAP Dependencies** My immediate concern is to understand the interplay between `CONFIG_SHMEM` and `CONFIG_SWAP`. Specifically, I need to confirm if enabling shared memory requires swap space, or if the swap mechanisms within the `shmem.c` file are conditional. My hunch is that while they are separate features, there might be situations, particularly concerning memory management under pressure, where the presence of swap becomes important or even necessary for `shmem`. I'll need to meticulously analyze the relevant code sections, looking for clear dependency declarations, preprocessor directives such as `#ifdef CONFIG_SWAP`, or subtle implicit dependencies revealed through function calls or data structure usage. I expect the code should use preprocessor directives, but it's important to verify. My analysis will focus on how the code handles memory pressure when `CONFIG_SHMEM` is active and whether swap is used for the backing store. Any uncovered relationships will be significant. |
| 30/2 | 2026/10/28 17:26 | tool | grepper |
0mError:no matches Args: {
"Expression": "CONFIG_SWAP",
"PathPrefixes": [
"mm/shmem.c",
"init/Kconfig"
]
}Results: {
"error": "no matches"
} |
| 31/2 | 2026/10/28 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 32353 output: 33 thoughts: 23 Thoughts: Here's a summary of my thought process, tailored for an expert like you: **Investigating `CONFIG_SHMEM` in `init/Kconfig`** Okay, so I see `CONFIG_SHMEM` mentioned in `init/Kconfig`. My immediate instinct is to dig into its definition. I need to understand what this option controls, especially in the context of system initialization. Is this something related to shared memory, which seems likely from the name? Is it a core feature, a debugging aid, or maybe an experimental option? Knowing the exact implications of this setting is crucial before proceeding. This could influence the entire initialization sequence and potentially impact shared memory management throughout the kernel's lifecycle. Time to examine the details. Let's see what the Kconfig file reveals... |
| 32/2 | 2026/10/28 17:26 | tool | read-file |
0mArgs:{
"File": "init/Kconfig",
"FirstLine": 1745,
"LineCount": 25
}Results: {
"Contents": "1745:\t\n1746:\t\t If unsure, say Y.\n1747:\t\n1748:\tconfig SHMEM\n1749:\t\tbool \"Use full shmem filesystem\" if EXPERT\n1750:\t\tdefault y\n1751:\t\tdepends on MMU\n1752:\t\thelp\n1753:\t\t The shmem is an internal filesystem used to manage shared memory.\n1754:\t\t It is backed by swap and manages resource limits. It is also exported\n1755:\t\t to userspace as tmpfs if TMPFS is enabled. Disabling this\n1756:\t\t option replaces shmem and tmpfs with the much simpler ramfs code,\n1757:\t\t which may be appropriate on small systems without swap.\n1758:\t\n1759:\tconfig AIO\n1760:\t\tbool \"Enable AIO support\" if EXPERT\n1761:\t\tdefault y\n1762:\t\thelp\n1763:\t\t This option enables POSIX asynchronous I/O which may by used\n1764:\t\t by some high performance threaded applications. Disabling\n1765:\t\t this option saves about 7k.\n1766:\t\n1767:\tconfig IO_URING\n1768:\t\tbool \"Enable IO uring support\" if EXPERT\n1769:\t\tselect IO_WQ\n"
} |
| 33/2 | 2026/10/28 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 32928 output: 357 thoughts: 1369 Thoughts: **Analysis of Filesystem and Memory Management Changes for Fuzzing** Okay, here's my breakdown of this analysis. I've been tasked with identifying key configurations and symbols for fuzzing efforts related to recent kernel changes. My first step was to determine the relevant configurations. It seems we have a list: `CONFIG_TMPFS_POSIX_ACL`, `CONFIG_TMPFS_QUOTA`, `CONFIG_TMPFS`, `CONFIG_HUGETLBFS`, `CONFIG_MEMFD_CREATE`, and `CONFIG_NUMA`. I then dove into the source code to confirm how these configs are used. `TMPFS_POSIX_ACL` is straightforward, an `#ifdef` in `mm/shmem.c`. `TMPFS_QUOTA` drives `shmem_quota.o`, `HUGETLBFS` enables `hugetlbfs.o`, and `NUMA` enables `mempolicy.o`. `MEMFD_CREATE` is used, and of course, `TMPFS` is fundamental for tmpfs functionality. A deeper look at the Kconfig revealed that `TMPFS_POSIX_ACL` also selects `TMPFS_XATTR` and `FS_POSIX_ACL`. Including `TMPFS_XATTR` doesn't seem to cause any problems, so it's fine. Therefore, the `EnableConfigs` list is correct: `TMPFS`, `TMPFS_POSIX_ACL`, `TMPFS_QUOTA`, `HUGETLBFS`, `MEMFD_CREATE`, and `NUMA`. Now, the crucial part: identifying the *FocusSymbols*. The code changes affect `hugetlbfs_setattr`, `shmem_setattr`, `shmem_set_acl`, `shmem_undo_range`, `shmem_get_partial_folio`, `shmem_free_swap`, `shmem_writeout`, `shmem_unuse`, `shmem_release_dquot`, and `shmem_swapin_folio`. Each of these functions is directly related to a specific subsystem and operation: hugetlbfs/tmpfs attribute setting, shmem truncation, ACL setting, pageout, swapoff, quota release, swapin, and swap entry handling during truncate. Critically, none of these are generic core functions. They are all specific to the areas being modified. These are exactly what we want as `FocusSymbols`, so I will include them in my list. Finally, the `Reasoning` section needs to be clear, explaining why these selections are appropriate. The patch modifies memory management related to tmpfs, hugetlbfs, and shmem quota code. Key changes include file seals during `chmod` and ACL modification, large folio splitting and swap entry handling, eviction prevention via stop_eviction counters, swapin-error marker handling, and dquot corrections. All modified paths are triggered via standard syscalls like `memfd_create`, `truncate`, `fchmod`, `setxattr/setfacl`, `fallocate`, `quotactl`, and `swapoff`, which are all standard syscalls. This justifies the `WorthFuzzing` being set to `true`. I am confident in the resulting configuration and symbol selection, so I will now call `set-results`. |
| 34/2 | 2026/10/28 17:27 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"TMPFS",
"TMPFS_POSIX_ACL",
"TMPFS_QUOTA",
"HUGETLBFS",
"MEMFD_CREATE",
"NUMA"
],
"FocusSymbols": [
"shmem_undo_range",
"shmem_setattr",
"hugetlbfs_setattr",
"shmem_set_acl",
"shmem_writeout",
"shmem_unuse",
"shmem_release_dquot",
"shmem_get_partial_folio",
"shmem_swapin_folio"
],
"Reasoning": "The patch modifies core memory management, tmpfs, hugetlbfs, and shmem quota code. Key changes include enforcing file seals (F_SEAL_EXEC) during chmod and ACL modification in both tmpfs and hugetlbfs (hugetlbfs_setattr, shmem_setattr, shmem_set_acl), handling large folio splitting and swap entry bounds to prevent infinite loops during shmem truncation and hole punching (shmem_undo_range, shmem_get_partial_folio), synchronizing inode eviction with swapout and swapoff using stop_eviction counters (shmem_writeout, shmem_unuse, shmem_evict_inode), and refining default dquot checks in shmem quota management (shmem_release_dquot). All modified paths are directly reachable in virtualized environments via syscalls such as memfd_create, fchmod, fallocate, truncate, setfacl, quotactl, and swapoff.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"TMPFS",
"TMPFS_POSIX_ACL",
"TMPFS_QUOTA",
"HUGETLBFS",
"MEMFD_CREATE",
"NUMA"
],
"FocusSymbols": [
"shmem_undo_range",
"shmem_setattr",
"hugetlbfs_setattr",
"shmem_set_acl",
"shmem_writeout",
"shmem_unuse",
"shmem_release_dquot",
"shmem_get_partial_folio",
"shmem_swapin_folio"
],
"Reasoning": "The patch modifies core memory management, tmpfs, hugetlbfs, and shmem quota code. Key changes include enforcing file seals (F_SEAL_EXEC) during chmod and ACL modification in both tmpfs and hugetlbfs (hugetlbfs_setattr, shmem_setattr, shmem_set_acl), handling large folio splitting and swap entry bounds to prevent infinite loops during shmem truncation and hole punching (shmem_undo_range, shmem_get_partial_folio), synchronizing inode eviction with swapout and swapoff using stop_eviction counters (shmem_writeout, shmem_unuse, shmem_evict_inode), and refining default dquot checks in shmem quota management (shmem_release_dquot). All modified paths are directly reachable in virtualized environments via syscalls such as memfd_create, fchmod, fallocate, truncate, setfacl, quotactl, and swapoff.",
"WorthFuzzing": true
} |
| 35/1 | 2026/10/28 17:27 | action | If |
1mArgs:{
"WorthFuzzing": true
}Results: null |
| 36/2 | 2026/10/28 17:27 | agent | kmsan-evaluator |
1mModel:core Args: null Results: {
"KMSANReasoning": "The patch series consists of several distinct fixes and improvements across hugetlbfs, memfd, mempolicy, and shmem:\n1. memfd seal enforcement: Adds `memfd_check_seals_mode()` to check `F_SEAL_EXEC` against mode changes in `hugetlbfs_setattr()`, `shmem_setattr()`, and tmpfs POSIX ACL sets (`shmem_set_acl()`).\n2. mempolicy slab accounting: Marks `policy_cache` and `sn_cache` with `SLAB_ACCOUNT`.\n3. shmem swap and folio management: Refines swap accounting and cleanup in `shmem_undo_range()` and `shmem_free_swap()`, marks dirty large folios to avoid discard on split failure, synchronizes inode eviction with writeout using `stop_eviction`, and fixes swap entry validation upon swapin failure.\n4. shmem quota: Updates `shmem_is_default_dquot()` to check soft limits and mount default limits.\n\nNone of these changes introduce or expose uninitialized memory:\n- No structures or buffers are copied to user space (no info-leaks).\n- No new uninitialized heap or stack variables are allocated, read, or branched upon.\n- Surrounding buffer access and folio data operations do not read uninitialized bytes.\n\nAny potential bugs introduced by these modifications would be synchronization/locking races (e.g., around `stop_eviction` or swap lists), page/folio refcounting or lifecycle bugs (such as use-after-free), or logic errors—all of which are covered by KASAN, LOCKDEP, and mm assertions. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit e1f9345f3463ab3370b0542f1b4c5e5acb9320bb
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Oct 28 17:21:15 2026 +0000
syz-cluster: applied patch under review
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 01c4d6f44ebe0a..02e0a65d596d86 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -28,6 +28,7 @@
#include <linux/folio_batch.h>
#include <linux/fs_parser.h>
#include <linux/mman.h>
+#include <linux/memfd.h>
#include <linux/slab.h>
#include <linux/dnotify.h>
#include <linux/statfs.h>
@@ -840,6 +841,13 @@ static int hugetlbfs_setattr(const struct mnt_idmap *idmap,
if (error)
return error;
+ if (S_ISREG(inode->i_mode) && (ia_valid & ATTR_MODE)) {
+ error = memfd_check_seals_mode(info->seals, inode->i_mode,
+ attr->ia_mode);
+ if (error)
+ return error;
+ }
+
trace_hugetlbfs_setattr(inode, dentry, attr);
if (ia_valid & ATTR_SIZE) {
diff --git a/include/linux/memfd.h b/include/linux/memfd.h
index c159e40e3f34a0..272479317cf10c 100644
--- a/include/linux/memfd.h
+++ b/include/linux/memfd.h
@@ -2,10 +2,19 @@
#ifndef __LINUX_MEMFD_H
#define __LINUX_MEMFD_H
+#include <linux/fcntl.h>
#include <linux/file.h>
#define MEMFD_ANON_NAME "[memfd]"
+static inline int memfd_check_seals_mode(unsigned int seals, umode_t old_mode,
+ umode_t new_mode)
+{
+ if ((seals & F_SEAL_EXEC) && ((old_mode ^ new_mode) & 0111))
+ return -EPERM;
+ return 0;
+}
+
#ifdef CONFIG_MEMFD_CREATE
extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);
struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0884c629670dd6..4da1cb8777f681 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -3372,11 +3372,11 @@ void __init numa_policy_init(void)
policy_cache = kmem_cache_create("numa_policy",
sizeof(struct mempolicy),
- 0, SLAB_PANIC, NULL);
+ 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);
sn_cache = kmem_cache_create("shared_policy_node",
sizeof(struct sp_node),
- 0, SLAB_PANIC, NULL);
+ 0, SLAB_PANIC | SLAB_ACCOUNT, NULL);
for_each_node(nid) {
preferred_node_policy[nid] = (struct mempolicy) {
diff --git a/mm/shmem.c b/mm/shmem.c
index af21a89abb0f63..9e51768ef46ccb 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -77,6 +77,7 @@ static struct vfsmount *shm_mnt __ro_after_init;
#include <linux/magic.h>
#include <linux/syscalls.h>
#include <linux/fcntl.h>
+#include <linux/memfd.h>
#include <uapi/linux/memfd.h>
#include <linux/rmap.h>
#include <linux/uuid.h>
@@ -1176,12 +1177,11 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap)
}
/*
- * Remove swap entry from page cache, free the swap and its page cache. Returns
- * the number of pages being freed. 0 means entry not found in XArray (0 pages
- * being freed).
+ * Remove a swap entry or swapin-error marker wholly within [index, end].
+ * Return whether it was removed, counting freed swap pages in nr_swaps_freed.
*/
-static long shmem_free_swap(struct address_space *mapping,
- pgoff_t index, pgoff_t end, void *radswap)
+static bool shmem_free_swap(struct address_space *mapping,
+ pgoff_t index, pgoff_t end, void *radswap, long *nr_swaps_freed)
{
XA_STATE(xas, &mapping->i_pages, index);
const softleaf_t swp = radix_to_swp_entry(radswap);
@@ -1202,8 +1202,10 @@ static long shmem_free_swap(struct address_space *mapping,
xas_unlock_irq(&xas);
/* A swapin-error marker holds no swap slot, so just drop it. */
- if (nr_pages && softleaf_is_swap(swp))
+ if (nr_pages && softleaf_is_swap(swp)) {
swap_put_entries_direct(swp, nr_pages);
+ *nr_swaps_freed += nr_pages;
+ }
return nr_pages;
}
@@ -1297,12 +1299,10 @@ void shmem_unlock_mapping(struct address_space *mapping)
static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)
{
+ const gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
struct folio *folio;
- /*
- * At first avoid shmem_get_folio(,,,SGP_READ): that fails
- * beyond i_size, and reports fallocated folios as holes.
- */
+retry:
folio = filemap_get_entry(inode->i_mapping, index);
if (!folio)
return folio;
@@ -1313,13 +1313,14 @@ static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index)
/* The folio has been swapped out */
folio_unlock(folio);
folio_put(folio);
+ goto retry;
}
/*
- * But read a folio back from swap if any of it is within i_size
- * (although in some cases this is just a waste of time).
+ * Truncation can look up a large swap entry at or beyond i_size.
+ * Swap it in directly to bypass the size check in shmem_get_folio().
*/
- folio = NULL;
- shmem_get_folio(inode, index, 0, &folio, SGP_READ);
+ if (shmem_swapin_folio(inode, index, &folio, SGP_READ, gfp, NULL, NULL) == -EEXIST)
+ goto retry;
return folio;
}
@@ -1358,8 +1359,8 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
if (xa_is_value(folio)) {
if (unfalloc)
continue;
- nr_swaps_freed += shmem_free_swap(mapping, indices[i],
- end - 1, folio);
+ shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed);
continue;
}
@@ -1422,32 +1423,31 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
if (xa_is_value(folio)) {
int order;
- long swaps_freed;
if (unfalloc)
continue;
- swaps_freed = shmem_free_swap(mapping, indices[i],
- end - 1, folio);
- if (!swaps_freed) {
+ if (!shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed)) {
pgoff_t base = indices[i];
order = shmem_confirm_swap(mapping, indices[i],
radix_to_swp_entry(folio));
/*
- * If found a large swap entry cross the end or start
- * border, skip it as the truncate_inode_partial_folio
- * above should have at least zerod its content once.
+ * Skip boundary entries when restarting
+ * the scan to avoid endless loops after
+ * swapin failure.
*/
if (order > 0) {
base = round_down(base, 1 << order);
- if (base < start || base + (1 << order) > end)
+ if (base < start || base + (1 << order) > end) {
+ start = max(start, base + (1 << order));
continue;
+ }
}
/* Swap was replaced by page or extended, retry */
index = base;
break;
}
- nr_swaps_freed += swaps_freed;
continue;
}
@@ -1463,23 +1463,35 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
VM_BUG_ON_FOLIO(folio_test_writeback(folio),
folio);
- if (!folio_test_large(folio)) {
+ /*
+ * A shared mapping can have dirty PTEs while
+ * the folio is still clean. Mark the folio
+ * dirty so a failed split cannot discard data
+ * outside the range.
+ */
+ if (!unfalloc && folio_test_large(folio))
+ folio_mark_dirty(folio);
+
+ if (unfalloc || !folio_test_large(folio)) {
truncate_inode_folio(mapping, folio);
} else if (truncate_inode_partial_folio(folio,
lstart, lend, NULL, NULL)) {
/*
- * If we split a page, reset the loop so
- * that we pick up the new sub pages.
- * Otherwise the THP was entirely
- * dropped or the target range was
- * zeroed, so just continue the loop as
- * is.
+ * The folio was split. Retry the scan
+ * to find the split folios.
*/
- if (!folio_test_large(folio)) {
- folio_unlock(folio);
- index = start;
- break;
- }
+ folio_unlock(folio);
+ index = start;
+ break;
+ } else if (folio->mapping) {
+ /*
+ * Splitting failed, but the part in the
+ * range is already zeroed. The folio
+ * was not dropped, so skip it when
+ * restarting the scan to avoid retrying
+ * it forever.
+ */
+ start = max(start, folio_next_index(folio));
}
}
folio_unlock(folio);
@@ -1546,10 +1558,11 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
if (error)
return error;
- if ((info->seals & F_SEAL_EXEC) && (attr->ia_valid & ATTR_MODE)) {
- if ((inode->i_mode ^ attr->ia_mode) & 0111) {
- return -EPERM;
- }
+ if (attr->ia_valid & ATTR_MODE) {
+ error = memfd_check_seals_mode(info->seals, inode->i_mode,
+ attr->ia_mode);
+ if (error)
+ return error;
}
if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) {
@@ -1578,7 +1591,8 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
if (oldsize > holebegin)
unmap_mapping_range(inode->i_mapping,
holebegin, 0, 1);
- if (info->alloced)
+ /* Swapin-error markers are not counted in alloced. */
+ if (info->alloced || !mapping_empty(inode->i_mapping))
shmem_truncate_range(inode,
newsize, (loff_t)-1);
/* unmap again to remove racily COWed private pages */
@@ -1614,6 +1628,17 @@ static int shmem_setattr(const struct mnt_idmap *idmap,
return error;
}
+static void shmem_disallow_eviction(struct shmem_inode_info *info)
+{
+ atomic_inc(&info->stop_eviction);
+}
+
+static void shmem_allow_eviction(struct shmem_inode_info *info)
+{
+ if (atomic_dec_and_test(&info->stop_eviction))
+ wake_up_var(&info->stop_eviction);
+}
+
static void shmem_evict_inode(struct inode *inode)
{
struct shmem_inode_info *info = SHMEM_I(inode);
@@ -1626,16 +1651,21 @@ static void shmem_evict_inode(struct inode *inode)
mapping_set_exiting(inode->i_mapping);
shmem_truncate_range(inode, 0, (loff_t)-1);
shmem_unused_huge_del(inode);
- while (!list_empty(&info->swaplist)) {
- /* Wait while shmem_unuse() is scanning this inode... */
+ /*
+ * Writeout may still use the inode after swapoff has removed it
+ * from the swaplist, so always wait at least once.
+ */
+ do {
wait_var_event(&info->stop_eviction,
!atomic_read(&info->stop_eviction));
+ if (list_empty(&info->swaplist))
+ break;
spin_lock(&shmem_swaplist_lock);
/* ...but beware of the race if we peeked too early */
if (!atomic_read(&info->stop_eviction))
list_del_init(&info->swaplist);
spin_unlock(&shmem_swaplist_lock);
- }
+ } while (!list_empty(&info->swaplist));
}
simple_xattrs_free(&sbinfo->xa_cache, &info->xattrs, sbinfo->max_inodes ? &freed : NULL);
@@ -1774,15 +1804,14 @@ int shmem_unuse(unsigned int type)
* remove placeholder inode from swaplist, nor let it be freed
* (igrab() would protect from unlink, but not from unmount).
*/
- atomic_inc(&info->stop_eviction);
+ shmem_disallow_eviction(info);
spin_unlock(&shmem_swaplist_lock);
error = shmem_unuse_inode(&info->vfs_inode, type);
cond_resched();
spin_lock(&shmem_swaplist_lock);
- if (atomic_dec_and_test(&info->stop_eviction))
- wake_up_var(&info->stop_eviction);
+ shmem_allow_eviction(info);
if (error)
break;
if (list_empty(&info->swaplist))
@@ -1913,6 +1942,13 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
spin_unlock(&shmem_swaplist_lock);
}
+ /*
+ * Once the folio has left the page cache, its lock no longer
+ * keeps the inode from being evicted and freed: hold eviction
+ * off, in case the folio has to be put back below.
+ */
+ shmem_disallow_eviction(info);
+
folio_dup_swap(folio, NULL);
shmem_delete_from_page_cache(folio, swp_to_radix_entry(folio->swap));
@@ -1920,6 +1956,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
error = swap_writeout(ctx, folio);
if (error != AOP_WRITEPAGE_ACTIVATE) {
/* folio has been unlocked */
+ shmem_allow_eviction(info);
return error;
}
@@ -1936,6 +1973,7 @@ int shmem_writeout(struct swap_io_ctx *ctx, struct folio *folio,
shmem_recalc_inode(inode, 0, -nr_pages);
folio_put_swap(folio, NULL);
}
+ shmem_allow_eviction(info);
/*
* The swap_cache_del_folio() below could be left for
@@ -2370,11 +2408,10 @@ static void shmem_set_folio_swapin_error(struct inode *inode, pgoff_t index,
folio_put_swap(folio, NULL);
swap_cache_del_folio(folio);
/*
- * Don't treat swapin error folio as alloced. Otherwise inode->i_blocks
- * won't be 0 when inode is released and thus trigger WARN_ON(i_blocks)
- * in shmem_evict_inode().
+ * Let shmem_recalc_inode() reduce alloced and release the block charge
+ * for the freed swap pages.
*/
- shmem_recalc_inode(inode, -nr_pages, -nr_pages);
+ shmem_recalc_inode(inode, 0, -nr_pages);
}
static int shmem_split_large_entry(struct inode *inode, pgoff_t index,
@@ -2515,6 +2552,8 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
else
error = -ENOMEM;
folio = NULL;
+ /* Make sure to validate the original value. */
+ swap = index_entry;
goto failed;
}
if (fault_type) {
@@ -5404,12 +5443,35 @@ static const struct file_operations shmem_file_operations = {
#endif
};
+#ifdef CONFIG_TMPFS_POSIX_ACL
+static int shmem_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,
+ struct posix_acl *acl, int type)
+{
+ struct inode *inode = d_inode(dentry);
+ umode_t mode = inode->i_mode;
+ int error;
+
+ if (type == ACL_TYPE_ACCESS) {
+ error = posix_acl_equiv_mode(acl, &mode);
+ if (error < 0)
+ return error;
+ error = memfd_check_seals_mode(SHMEM_I(inode)->seals,
+ inode->i_mode, mode);
+ if (error)
+ return error;
+ }
+ return simple_set_acl(idmap, dentry, acl, type);
+}
+#else
+#define shmem_set_acl NULL
+#endif
+
static const struct inode_operations shmem_inode_operations = {
.getattr = shmem_getattr,
.setattr = shmem_setattr,
#ifdef CONFIG_TMPFS_XATTR
.listxattr = shmem_listxattr,
- .set_acl = simple_set_acl,
+ .set_acl = shmem_set_acl,
.fileattr_get = shmem_fileattr_get,
.fileattr_set = shmem_fileattr_set,
#endif
diff --git a/mm/shmem_quota.c b/mm/shmem_quota.c
index a3fa4bd93e753a..d191ebda3f00e5 100644
--- a/mm/shmem_quota.c
+++ b/mm/shmem_quota.c
@@ -239,7 +239,7 @@ static int shmem_acquire_dquot(struct dquot *dquot)
return ret;
}
-static bool shmem_is_empty_dquot(struct dquot *dquot)
+static bool shmem_is_default_dquot(struct dquot *dquot)
{
struct shmem_sb_info *sbinfo = dquot->dq_sb->s_fs_info;
qsize_t bhardlimit;
@@ -253,19 +253,21 @@ static bool shmem_is_empty_dquot(struct dquot *dquot)
ihardlimit = sbinfo->qlimits.grpquota_ihardlimit;
}
- if (test_bit(DQ_FAKE_B, &dquot->dq_flags) ||
- (dquot->dq_dqb.dqb_curspace == 0 &&
- dquot->dq_dqb.dqb_curinodes == 0 &&
- dquot->dq_dqb.dqb_bhardlimit == bhardlimit &&
- dquot->dq_dqb.dqb_ihardlimit == ihardlimit))
- return true;
-
- return false;
+ /*
+ * Defaults are zero usage and soft limits, and the mount's hard limits.
+ * DQ_FAKE_B only means that *all* limits are zero, which need not match
+ * the mount defaults.
+ */
+ return dquot->dq_dqb.dqb_curspace == 0 &&
+ dquot->dq_dqb.dqb_curinodes == 0 &&
+ dquot->dq_dqb.dqb_bsoftlimit == 0 &&
+ dquot->dq_dqb.dqb_isoftlimit == 0 &&
+ dquot->dq_dqb.dqb_bhardlimit == bhardlimit &&
+ dquot->dq_dqb.dqb_ihardlimit == ihardlimit;
}
/*
- * Store limits from dquot in the tree unless it's fake. If it is fake
- * remove the id from the tree since there is no useful information in
- * there.
+ * Remove the ID from the tree if it has no usage and its limits match
+ * the mount defaults. Otherwise, save its limits for the next acquire.
*/
static int shmem_release_dquot(struct dquot *dquot)
{
@@ -300,7 +302,7 @@ static int shmem_release_dquot(struct dquot *dquot)
return -ENOENT;
found:
- if (shmem_is_empty_dquot(dquot)) {
+ if (shmem_is_default_dquot(dquot)) {
/* Remove entry from the tree */
rb_erase(&entry->node, info->dqi_priv);
kfree(entry);
|
| 37/3 | 2026/10/28 17:27 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8236 output: 34 thoughts: 1234 Thoughts: **KMSAN Fuzzing Session Assessment** Okay, let's break this down. My primary concern here is whether this patch series warrants a dedicated KMSAN fuzzing session. Given the resources involved, I need to be sure. I'm going to carefully analyze each patch and determine if it introduces any uninitialized memory risks that KMSAN is specifically designed to catch. I'll need to scrutinize the code changes against the established criteria. First, I see changes in `fs/hugetlbfs/inode.c`. The `hugetlbfs_setattr` function now includes a check using `memfd_check_seals_mode`. The arguments to the function, namely `inode->i_mode` and `attr->ia_mode`, appear to be properly initialized, given the check on `ia_valid`. This doesn't scream KMSAN risk right off the bat. Then there is the introduction of `memfd_check_seals_mode` itself, in `include/linux/memfd.h`. This is a helper function, and it seems simple enough. It's just checking if a file seal prevents execution bit changes. No immediate uninitialized memory concerns here. The changes in `mm/mempolicy.c` with the addition of `SLAB_ACCOUNT` to `policy_cache` and `sn_cache` kmem_cache_create in `numa_policy_init()` look like standard memory allocation and cache setup. These changes do not warrant a KMSAN session. Now, `mm/shmem.c` is where things might get interesting. There are multiple changes here, and I'll need to go through this methodically. `shmem_free_swap` has a changed signature returning a bool and updating `*nr_swaps_freed`, let's make sure it is initialized before being used. In `shmem_undo_range`, there is a local variable `long nr_swaps_freed = 0;`, so that looks fine. There are several calls to `memfd_check_seals_mode()` in `shmem_setattr()` and `shmem_set_acl()`, which, as we established earlier, don't pose a KMSAN risk themselves. `shmem_evict_inode()`, `shmem_unuse()`, `shmem_writeout()`, `shmem_set_folio_swapin_error()` and `shmem_swapin_folio()` also seem to deal with existing variables being used correctly. The changes in `mm/shmem_quota.c`, renaming `shmem_is_empty_dquot` and checking soft and hard limits, don't appear to present any uninitialized memory issues either. So, let's go back and carefully check the instructions: The rules dictate that I should only flag `NeedsKMSAN=true` if the patch introduces or modifies kernel structures sent to userspace, conditional logic using uninitialized variables, complex data structure allocations where uninitialized fields could be read, or vulnerabilities that allow access to uninitialized bytes of existing buffers. Looking back at the entire series, I do not see any of the above situations. No kernel structures are being sent to userspace with potentially uninitialized fields, no conditional logic relies on uninitialized variables, and no complex data structures are allocated in a way that risks uninitialized reads. Therefore, after a thorough review, I'm confident that these changes do not introduce any risks that necessitate a dedicated KMSAN fuzzing session. The patch seems to be safe with respect to uninitialized memory access. **NeedsKMSAN=false** |
| 38/3 | 2026/10/28 17:27 | tool | grepper |
0mArgs:{
"Expression": "nr_swaps_freed",
"PathPrefixes": [
"mm/shmem.c"
]
}Results: {
"Output": "mm/shmem.c=1163=static void shmem_delete_from_page_cache(struct folio *folio, void *radswap)\n--\nmm/shmem.c-1180- * Remove a swap entry or swapin-error marker wholly within [index, end].\nmm/shmem.c:1181: * Return whether it was removed, counting freed swap pages in nr_swaps_freed.\nmm/shmem.c-1182- */\nmm/shmem.c=1183=static bool shmem_free_swap(struct address_space *mapping,\nmm/shmem.c:1184:\t\tpgoff_t index, pgoff_t end, void *radswap, long *nr_swaps_freed)\nmm/shmem.c-1185-{\n--\nmm/shmem.c-1206-\t\tswap_put_entries_direct(swp, nr_pages);\nmm/shmem.c:1207:\t\t*nr_swaps_freed += nr_pages;\nmm/shmem.c-1208-\t}\n--\nmm/shmem.c=1331=static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,\n--\nmm/shmem.c-1341-\tbool same_folio;\nmm/shmem.c:1342:\tlong nr_swaps_freed = 0;\nmm/shmem.c-1343-\tpgoff_t index;\n--\nmm/shmem.c-1362-\t\t\t\tshmem_free_swap(mapping, indices[i], end - 1,\nmm/shmem.c:1363:\t\t\t\t\t\tfolio, \u0026nr_swaps_freed);\nmm/shmem.c-1364-\t\t\t\tcontinue;\n--\nmm/shmem.c-1429-\t\t\t\tif (!shmem_free_swap(mapping, indices[i], end - 1,\nmm/shmem.c:1430:\t\t\t\t\t\t folio, \u0026nr_swaps_freed)) {\nmm/shmem.c-1431-\t\t\t\t\tpgoff_t base = indices[i];\n--\nmm/shmem.c-1502-\nmm/shmem.c:1503:\tshmem_recalc_inode(inode, 0, -nr_swaps_freed);\nmm/shmem.c-1504-}\n"
} |
| 39/3 | 2026/10/28 17:27 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10901 output: 35 thoughts: 380 Thoughts: **My Current Thinking About `shmem` and ACLs** Okay, so I'm looking into the `shmem` code, specifically the interaction between Access Control Lists (ACLs) and swap operations. I see that `nr_swaps_freed` gets initialized to 0 in `shmem_undo_range`, that's a good starting point. Now, let's zoom in on `shmem_set_acl`. This function, at first glance, seems straightforward. It takes a dentry, an ACL, and a type. Inside, `mode` is initialized with the inode's mode. The interesting part is how `posix_acl_equiv_mode` works. It's passed the *address* of `mode`, so it can potentially modify it. A negative return from `posix_acl_equiv_mode` means an error, and the function returns immediately. Otherwise, `mode` is updated. And it is being passed to another check for seals. Now, my mind wanders to how ACL changes might interact with swapping. I'm wondering if there are any subtle interactions or potential race conditions. I need to understand how the inode's mode is handled during swap operations and how ACLs are preserved. Specifically, let me shift gears and check what's happening with `shmem_swapin_folio`. It looks like there's an `error` check and assignment around line 2515 to 2552 in `mm/shmem.c`. Let's dig deeper in that area and see what happens with folio handling and error management, and how this is related to the rest of the file. |
| 40/3 | 2026/10/28 17:28 | tool | read-file |
0mArgs:{
"File": "mm/shmem.c",
"FirstLine": 2500,
"LineCount": 70
}Results: {
"Contents": "2500:\t\tstruct address_space *mapping = inode-\u003ei_mapping;\n2501:\t\tstruct vm_area_struct *vma = vmf ? vmf-\u003evma : NULL;\n2502:\t\tstruct mm_struct *fault_mm = vmf ? vmf-\u003evma-\u003evm_mm : NULL;\n2503:\t\tstruct shmem_inode_info *info = SHMEM_I(inode);\n2504:\t\tswp_entry_t swap;\n2505:\t\tsoftleaf_t index_entry;\n2506:\t\tstruct swap_info_struct *si;\n2507:\t\tstruct folio *folio = NULL;\n2508:\t\tint error, nr_pages, order;\n2509:\t\tpgoff_t offset;\n2510:\t\n2511:\t\tVM_BUG_ON(!*foliop || !xa_is_value(*foliop));\n2512:\t\tindex_entry = radix_to_swp_entry(*foliop);\n2513:\t\tswap = index_entry;\n2514:\t\t*foliop = NULL;\n2515:\t\n2516:\t\tif (softleaf_is_poison_marker(index_entry))\n2517:\t\t\treturn -EIO;\n2518:\t\n2519:\t\tsi = get_swap_device(index_entry);\n2520:\t\torder = shmem_confirm_swap(mapping, index, index_entry);\n2521:\t\tif (IS_ERR_OR_NULL(si)) {\n2522:\t\t\tif (order \u003c 0)\n2523:\t\t\t\treturn -EEXIST;\n2524:\t\t\telse\n2525:\t\t\t\treturn -EINVAL;\n2526:\t\t}\n2527:\t\tif (unlikely(order \u003c 0)) {\n2528:\t\t\tput_swap_device(si);\n2529:\t\t\treturn -EEXIST;\n2530:\t\t}\n2531:\t\n2532:\t\t/* index may point to the middle of a large entry, get the sub entry */\n2533:\t\tif (order) {\n2534:\t\t\toffset = index - round_down(index, 1 \u003c\u003c order);\n2535:\t\t\tswap = swp_entry(swp_type(swap), swp_offset(swap) + offset);\n2536:\t\t}\n2537:\t\n2538:\t\t/* Look it up and read it in.. */\n2539:\t\tfolio = swap_cache_get_folio(swap);\n2540:\t\tif (!folio) {\n2541:\t\t\tif (data_race(si-\u003eflags \u0026 SWP_SYNCHRONOUS_IO)) {\n2542:\t\t\t\t/* Direct swapin skipping swap cache \u0026 readahead */\n2543:\t\t\t\tfolio = shmem_swap_alloc_folio(inode, vmf, index,\n2544:\t\t\t\t\t\t\t swap, order, gfp);\n2545:\t\t\t} else {\n2546:\t\t\t\t/* Cached swapin only supports order 0 folio */\n2547:\t\t\t\tfolio = shmem_swapin_cluster(swap, gfp, info, index);\n2548:\t\t\t}\n2549:\t\t\tif (IS_ERR_OR_NULL(folio)) {\n2550:\t\t\t\tif (IS_ERR(folio))\n2551:\t\t\t\t\terror = PTR_ERR(folio);\n2552:\t\t\t\telse\n2553:\t\t\t\t\terror = -ENOMEM;\n2554:\t\t\t\tfolio = NULL;\n2555:\t\t\t\t/* Make sure to validate the original value. */\n2556:\t\t\t\tswap = index_entry;\n2557:\t\t\t\tgoto failed;\n2558:\t\t\t}\n2559:\t\t\tif (fault_type) {\n2560:\t\t\t\t*fault_type |= VM_FAULT_MAJOR;\n2561:\t\t\t\tcount_vm_event(PGMAJFAULT);\n2562:\t\t\t\tcount_memcg_event_mm(fault_mm, PGMAJFAULT);\n2563:\t\t\t}\n2564:\t\t} else {\n2565:\t\t\tswap_update_readahead(folio, NULL, 0);\n2566:\t\t}\n2567:\t\n2568:\t\tif (order \u003e folio_order(folio)) {\n2569:\t\t\t/*\n"
} |
| 41/3 | 2026/10/28 17:28 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12768 output: 35 thoughts: 20 Thoughts: Here's a summary of my thought process, focusing on what I'd be looking for when examining that code: **Diving into `shmem_swapin_folio` and the `failed:` Label** Okay, so I'm looking at `shmem_swapin_folio`. My immediate focus is on that `failed:` label. It's a key indicator of where things might go wrong during a swap-in operation. I want to understand *why* we might end up jumping there. What conditions trigger that branch? What are the potential failure scenarios? I need to trace the execution path that leads to `failed:`. I'll be meticulously checking the surrounding code, especially the conditional statements and error checks that precede it. Am I dealing with a resource allocation issue? Maybe a problem with the underlying storage? Perhaps some form of data corruption or a lock contention issue? Understanding the *cause* of the failure is paramount. I'll be paying close attention to any error codes or return values that are set before the jump. Are there specific error codes being used to pinpoint the failure? What's their significance within this specific context? What's the error handling at `failed:`? Does it try to retry? Does it log something? Does it attempt cleanup? Knowing the failure mechanism is vital for any troubleshooting or performance analysis. I'll keep a sharp eye out for potential race conditions or synchronization issues around the `failed:` path. Especially in a shared memory context, concurrency problems can be subtle and difficult to track down. It’s also imperative to see how the function interacts with other functions and system components, especially if there are any locks or shared resources involved. I'll need to verify that this function properly handles the potential for concurrent access. Essentially, I'm treating `failed:` as a diagnostic endpoint. My goal is to reconstruct the failure mode completely, from the initial trigger to the final error handling. This is critical for understanding reliability and potential areas for improvement in the swapping mechanism. |
| 42/3 | 2026/10/28 17:28 | tool | read-file |
0mArgs:{
"File": "mm/shmem.c",
"FirstLine": 2650,
"LineCount": 40
}Results: {
"Contents": "2650:\t\t\tshmem_set_folio_swapin_error(inode, index, folio, swap);\n2651:\tunlock:\n2652:\t\tif (folio)\n2653:\t\t\tfolio_unlock(folio);\n2654:\tfailed_nolock:\n2655:\t\tif (folio)\n2656:\t\t\tfolio_put(folio);\n2657:\t\tput_swap_device(si);\n2658:\t\n2659:\t\treturn error;\n2660:\t}\n2661:\t\n2662:\t/*\n2663:\t * shmem_get_folio_gfp - find page in cache, or get from swap, or allocate\n2664:\t *\n2665:\t * If we allocate a new one we do not mark it dirty. That's up to the\n2666:\t * vm. If we swap it in we mark it dirty since we also free the swap\n2667:\t * entry since a page cannot live in both the swap and page cache.\n2668:\t *\n2669:\t * vmf and fault_type are only supplied by shmem_fault: otherwise they are NULL.\n2670:\t */\n2671:\tstatic int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,\n2672:\t\t\tloff_t write_end, struct folio **foliop, enum sgp_type sgp,\n2673:\t\t\tgfp_t gfp, struct vm_fault *vmf, vm_fault_t *fault_type)\n2674:\t{\n2675:\t\tstruct vm_area_struct *vma = vmf ? vmf-\u003evma : NULL;\n2676:\t\tstruct mm_struct *fault_mm;\n2677:\t\tstruct folio *folio;\n2678:\t\tint error;\n2679:\t\tbool alloced;\n2680:\t\tunsigned long orders = 0;\n2681:\t\n2682:\t\tif (WARN_ON_ONCE(!shmem_mapping(inode-\u003ei_mapping)))\n2683:\t\t\treturn -EINVAL;\n2684:\t\n2685:\t\tif (index \u003e (MAX_LFS_FILESIZE \u003e\u003e PAGE_SHIFT))\n2686:\t\t\treturn -EFBIG;\n2687:\trepeat:\n2688:\t\tif (sgp \u003c= SGP_CACHE \u0026\u0026\n2689:\t\t ((loff_t)index \u003c\u003c PAGE_SHIFT) \u003e= i_size_read(inode))\n"
} |
| 43/3 | 2026/10/28 17:28 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13895 output: 35 thoughts: 24 Thoughts: Okay, here's my interpretation of what's going on in those lines of `mm/shmem.c`, summarized from my perspective: **Diving into Shared Memory Management (shmem.c)** Alright, so I'm focusing in on lines 2630-2655 of `mm/shmem.c`. Let's get down to the nitty-gritty of how this shared memory (shmem) thing is handled. My understanding is that the code in this section is probably dealing with some crucial aspect of allocating or deallocating resources related to shared memory segments, but specifically the details of which are what I'm seeking to understand. |
| 44/3 | 2026/10/28 17:28 | tool | read-file |
0mArgs:{
"File": "mm/shmem.c",
"FirstLine": 2630,
"LineCount": 25
}Results: {
"Contents": "2630:\t\t\t\t\t\tswp_to_radix_entry(swap), gfp);\n2631:\t\tif (error)\n2632:\t\t\tgoto failed;\n2633:\t\n2634:\t\tshmem_recalc_inode(inode, 0, -nr_pages);\n2635:\t\n2636:\t\tif (sgp == SGP_WRITE)\n2637:\t\t\tfolio_mark_accessed(folio);\n2638:\t\n2639:\t\tfolio_put_swap(folio, NULL);\n2640:\t\tswap_cache_del_folio(folio);\n2641:\t\tfolio_mark_dirty(folio);\n2642:\t\tput_swap_device(si);\n2643:\t\n2644:\t\t*foliop = folio;\n2645:\t\treturn 0;\n2646:\tfailed:\n2647:\t\tif (shmem_confirm_swap(mapping, index, swap) \u003c 0)\n2648:\t\t\terror = -EEXIST;\n2649:\t\tif (error == -EIO)\n2650:\t\t\tshmem_set_folio_swapin_error(inode, index, folio, swap);\n2651:\tunlock:\n2652:\t\tif (folio)\n2653:\t\t\tfolio_unlock(folio);\n2654:\tfailed_nolock:\n"
} |
| 45/3 | 2026/10/28 17:28 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14462 output: 393 thoughts: 1533 Thoughts: **KMSAN Reasoning: Determining the Need for Kernel Memory Sanitizer** Okay, let's break this down. First, I'm examining this patch series and thinking through the potential implications for KMSAN. The core of the changes seem to revolve around file system seal checks, memory cgroup accounting, and shmem pagecache/swap/eviction synchronization. Specifically, I'm looking at how `shmem_swapin_folio` handles `swap`, and how the patch series affects execution seals in `hugetlbfs`, `shmem`, and ACL handling. Also, I see an update in `shmem_quota` for its default dquot checks, and `SLAB_ACCOUNT` added to `policy_cache` and `sn_cache`. Now, the critical question is whether these changes introduce or expose risks detectable *only* by KMSAN. I'm focusing on those four conditions: user-space exposure of uninitialized data, branching on uninitialized memory, uninitialized fields in complex data structures, and the potential for reading uninitialized bytes due to boundary logic changes. Let's drill down on the code. In `shmem_swapin_folio`, the concern is if the `swap` variable gets altered before `shmem_confirm_swap` is called. This is a subtle point, but by ensuring that `swap` is set back to `index_entry`, the logic should be sound. In the broader scope, after reviewing each of the modified files, including `hugetlbfs_setattr`, `shmem_free_swap`, `shmem_get_partial_folio`, `shmem_undo_range`, `shmem_setattr`, `shmem_disallow_eviction`, `shmem_allow_eviction`, `shmem_set_folio_swapin_error`, and `shmem_set_acl`, I'm looking for anything that touches user-space memory, uses uninitialized variables in conditionals, or introduces complex data structure initialization issues. I'm systematically going through the criteria: Nothing is copied directly to user space. There are no obvious uninitialized variables used in conditional statements, and I see no new instances of complex data structures with potentially uninitialized fields that could be read later. I'm also not seeing any changes to buffer boundaries that could lead to reading uninitialized memory. Allocation changes appear to be limited to the addition of `SLAB_ACCOUNT`. The shmem changes involve page cache entries, locking, refcounting, swap entries, error handling, and truncation – all complex areas, but the code seems to handle them correctly in this patch series. The relevant kernel documentation is clear: KMSAN is for catching *uninitialized* memory access. These changes deal more with synchronization, locking, and data consistency within the kernel itself. These potential issues are things like race conditions, deadlocks, use-after-free, refcounting errors, and logic errors. These are the kinds of issues that KASAN, LOCKDEP, and standard kernel debugging tools are designed to catch. Therefore, because none of the KMSAN-specific conditions are met, I can confidently conclude: **NeedsKMSAN = false.** I can prepare a summary that will contrast the strengths of KMSAN with those of KASAN: **Summary of the Changes:** 1. Memfd seal checks for execution bit changes are added in `hugetlbfs_setattr`, `shmem_setattr`, and `shmem_set_acl`. 2. `SLAB_ACCOUNT` is added to numa\_policy and shared\_policy\_node slab caches. 3. Changes for swap handling, truncation, eviction synchronization (protecting inode eviction during writeout/unuse), and folio dirty marking in `mm/shmem.c`. 4. Quota default check refinement in `mm/shmem_quota.c`. **Why KMSAN is Not Applicable:** * No kernel memory or structs are copied to user space (no `copy_to_user`, netlink skb, socket options, ioctls). * No uninitialized variables or struct fields are read or used in branching/conditional logic. * No buffers or allocations are left uninitialized. **KASAN/LOCKDEP Coverage:** Potential bugs include concurrency issues (refcounting `stop_eviction`, wait queues), folio lifetime and page-cache races (use-after-free or double free), memory leaks, or cgroup accounting bugs. These issues are best covered by KASAN, LOCKDEP, and page/folio assertions (VM\_BUG\_ON). Not KMSAN. The `set-results` tool can be called now. |
| 46/3 | 2026/10/28 17:29 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch series consists of several distinct fixes and improvements across hugetlbfs, memfd, mempolicy, and shmem:\n1. memfd seal enforcement: Adds `memfd_check_seals_mode()` to check `F_SEAL_EXEC` against mode changes in `hugetlbfs_setattr()`, `shmem_setattr()`, and tmpfs POSIX ACL sets (`shmem_set_acl()`).\n2. mempolicy slab accounting: Marks `policy_cache` and `sn_cache` with `SLAB_ACCOUNT`.\n3. shmem swap and folio management: Refines swap accounting and cleanup in `shmem_undo_range()` and `shmem_free_swap()`, marks dirty large folios to avoid discard on split failure, synchronizes inode eviction with writeout using `stop_eviction`, and fixes swap entry validation upon swapin failure.\n4. shmem quota: Updates `shmem_is_default_dquot()` to check soft limits and mount default limits.\n\nNone of these changes introduce or expose uninitialized memory:\n- No structures or buffers are copied to user space (no info-leaks).\n- No new uninitialized heap or stack variables are allocated, read, or branched upon.\n- Surrounding buffer access and folio data operations do not read uninitialized bytes.\n\nAny potential bugs introduced by these modifications would be synchronization/locking races (e.g., around `stop_eviction` or swap lists), page/folio refcounting or lifecycle bugs (such as use-after-free), or logic errors—all of which are covered by KASAN, LOCKDEP, and mm assertions. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch series consists of several distinct fixes and improvements across hugetlbfs, memfd, mempolicy, and shmem:\n1. memfd seal enforcement: Adds `memfd_check_seals_mode()` to check `F_SEAL_EXEC` against mode changes in `hugetlbfs_setattr()`, `shmem_setattr()`, and tmpfs POSIX ACL sets (`shmem_set_acl()`).\n2. mempolicy slab accounting: Marks `policy_cache` and `sn_cache` with `SLAB_ACCOUNT`.\n3. shmem swap and folio management: Refines swap accounting and cleanup in `shmem_undo_range()` and `shmem_free_swap()`, marks dirty large folios to avoid discard on split failure, synchronizes inode eviction with writeout using `stop_eviction`, and fixes swap entry validation upon swapin failure.\n4. shmem quota: Updates `shmem_is_default_dquot()` to check soft limits and mount default limits.\n\nNone of these changes introduce or expose uninitialized memory:\n- No structures or buffers are copied to user space (no info-leaks).\n- No new uninitialized heap or stack variables are allocated, read, or branched upon.\n- Surrounding buffer access and folio data operations do not read uninitialized bytes.\n\nAny potential bugs introduced by these modifications would be synchronization/locking races (e.g., around `stop_eviction` or swap lists), page/folio refcounting or lifecycle bugs (such as use-after-free), or logic errors—all of which are covered by KASAN, LOCKDEP, and mm assertions. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|