Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mm-hotfixes-stable-2025-06-27-16-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
"16 hotfixes.

6 are cc:stable and the remainder address post-6.15 issues or aren't
considered necessary for -stable kernels. 5 are for MM"

* tag 'mm-hotfixes-stable-2025-06-27-16-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
MAINTAINERS: add Lorenzo as THP co-maintainer
mailmap: update Duje Mihanović's email address
selftests/mm: fix validate_addr() helper
crashdump: add CONFIG_KEYS dependency
mailmap: correct name for a historical account of Zijun Hu
mailmap: add entries for Zijun Hu
fuse: fix runtime warning on truncate_folio_batch_exceptionals()
scripts/gdb: fix dentry_name() lookup
mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write
mm/alloc_tag: fix the kmemleak false positive issue in the allocation of the percpu variable tag->counters
lib/group_cpus: fix NULL pointer dereference from group_cpus_evenly()
mm/hugetlb: remove unnecessary holding of hugetlb_lock
MAINTAINERS: add missing files to mm page alloc section
MAINTAINERS: add tree entry to mm init block
mm: add OOM killer maintainer structure
fs/proc/task_mmu: fix PAGE_IS_PFNZERO detection for the huge zero folio

+90 -44
+4
.mailmap
··· 224 224 Domen Puncer <domen@coderock.org> 225 225 Douglas Gilbert <dougg@torque.net> 226 226 Drew Fustini <fustini@kernel.org> <drew@pdp7.com> 227 + <duje@dujemihanovic.xyz> <duje.mihanovic@skole.hr> 227 228 Ed L. Cashin <ecashin@coraid.com> 228 229 Elliot Berman <quic_eberman@quicinc.com> <eberman@codeaurora.org> 229 230 Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com> ··· 832 831 Yusuke Goda <goda.yusuke@renesas.com> 833 832 Zack Rusin <zack.rusin@broadcom.com> <zackr@vmware.com> 834 833 Zhu Yanjun <zyjzyj2000@gmail.com> <yanjunz@nvidia.com> 834 + Zijun Hu <zijun.hu@oss.qualcomm.com> <quic_zijuhu@quicinc.com> 835 + Zijun Hu <zijun.hu@oss.qualcomm.com> <zijuhu@codeaurora.org> 836 + Zijun Hu <zijun_hu@htc.com>
+23 -1
MAINTAINERS
··· 15676 15676 M: Mike Rapoport <rppt@kernel.org> 15677 15677 L: linux-mm@kvack.org 15678 15678 S: Maintained 15679 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git for-next 15680 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git fixes 15679 15681 F: Documentation/core-api/boot-time-mm.rst 15680 15682 F: Documentation/core-api/kho/bindings/memblock/* 15681 15683 F: include/linux/memblock.h ··· 15850 15848 F: mm/numa_emulation.c 15851 15849 F: mm/numa_memblks.c 15852 15850 15851 + MEMORY MANAGEMENT - OOM KILLER 15852 + M: Michal Hocko <mhocko@suse.com> 15853 + R: David Rientjes <rientjes@google.com> 15854 + R: Shakeel Butt <shakeel.butt@linux.dev> 15855 + L: linux-mm@kvack.org 15856 + S: Maintained 15857 + F: include/linux/oom.h 15858 + F: include/trace/events/oom.h 15859 + F: include/uapi/linux/oom.h 15860 + F: mm/oom_kill.c 15861 + 15853 15862 MEMORY MANAGEMENT - PAGE ALLOCATOR 15854 15863 M: Andrew Morton <akpm@linux-foundation.org> 15855 15864 M: Vlastimil Babka <vbabka@suse.cz> ··· 15875 15862 F: include/linux/gfp.h 15876 15863 F: include/linux/page-isolation.h 15877 15864 F: mm/compaction.c 15865 + F: mm/debug_page_alloc.c 15866 + F: mm/fail_page_alloc.c 15878 15867 F: mm/page_alloc.c 15868 + F: mm/page_ext.c 15869 + F: mm/page_frag_cache.c 15879 15870 F: mm/page_isolation.c 15871 + F: mm/page_owner.c 15872 + F: mm/page_poison.c 15873 + F: mm/page_reporting.c 15874 + F: mm/show_mem.c 15875 + F: mm/shuffle.c 15880 15876 15881 15877 MEMORY MANAGEMENT - RECLAIM 15882 15878 M: Andrew Morton <akpm@linux-foundation.org> ··· 15945 15923 MEMORY MANAGEMENT - THP (TRANSPARENT HUGE PAGE) 15946 15924 M: Andrew Morton <akpm@linux-foundation.org> 15947 15925 M: David Hildenbrand <david@redhat.com> 15926 + M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> 15948 15927 R: Zi Yan <ziy@nvidia.com> 15949 15928 R: Baolin Wang <baolin.wang@linux.alibaba.com> 15950 - R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> 15951 15929 R: Liam R. Howlett <Liam.Howlett@oracle.com> 15952 15930 R: Nico Pache <npache@redhat.com> 15953 15931 R: Ryan Roberts <ryan.roberts@arm.com>
+4
fs/fuse/inode.c
··· 9 9 #include "fuse_i.h" 10 10 #include "dev_uring_i.h" 11 11 12 + #include <linux/dax.h> 12 13 #include <linux/pagemap.h> 13 14 #include <linux/slab.h> 14 15 #include <linux/file.h> ··· 162 161 163 162 /* Will write inode on close/munmap and in all other dirtiers */ 164 163 WARN_ON(inode->i_state & I_DIRTY_INODE); 164 + 165 + if (FUSE_IS_DAX(inode)) 166 + dax_break_layout_final(inode); 165 167 166 168 truncate_inode_pages_final(&inode->i_data); 167 169 clear_inode(inode);
+1 -1
fs/proc/task_mmu.c
··· 2182 2182 categories |= PAGE_IS_FILE; 2183 2183 } 2184 2184 2185 - if (is_zero_pfn(pmd_pfn(pmd))) 2185 + if (is_huge_zero_pmd(pmd)) 2186 2186 categories |= PAGE_IS_PFNZERO; 2187 2187 if (pmd_soft_dirty(pmd)) 2188 2188 categories |= PAGE_IS_SOFT_DIRTY;
+4
include/linux/kmemleak.h
··· 28 28 extern void kmemleak_not_leak(const void *ptr) __ref; 29 29 extern void kmemleak_transient_leak(const void *ptr) __ref; 30 30 extern void kmemleak_ignore(const void *ptr) __ref; 31 + extern void kmemleak_ignore_percpu(const void __percpu *ptr) __ref; 31 32 extern void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) __ref; 32 33 extern void kmemleak_no_scan(const void *ptr) __ref; 33 34 extern void kmemleak_alloc_phys(phys_addr_t phys, size_t size, ··· 96 95 { 97 96 } 98 97 static inline void kmemleak_transient_leak(const void *ptr) 98 + { 99 + } 100 + static inline void kmemleak_ignore_percpu(const void __percpu *ptr) 99 101 { 100 102 } 101 103 static inline void kmemleak_ignore(const void *ptr)
+1
kernel/Kconfig.kexec
··· 134 134 depends on KEXEC_FILE 135 135 depends on CRASH_DUMP 136 136 depends on DM_CRYPT 137 + depends on KEYS 137 138 help 138 139 With this option enabled, user space can intereact with 139 140 /sys/kernel/config/crash_dm_crypt_keys to make the dm crypt keys
+7 -1
lib/alloc_tag.c
··· 10 10 #include <linux/seq_buf.h> 11 11 #include <linux/seq_file.h> 12 12 #include <linux/vmalloc.h> 13 + #include <linux/kmemleak.h> 13 14 14 15 #define ALLOCINFO_FILE_NAME "allocinfo" 15 16 #define MODULE_ALLOC_TAG_VMAP_SIZE (100000UL * sizeof(struct alloc_tag)) ··· 633 632 mod->name); 634 633 return -ENOMEM; 635 634 } 636 - } 637 635 636 + /* 637 + * Avoid a kmemleak false positive. The pointer to the counters is stored 638 + * in the alloc_tag section of the module and cannot be directly accessed. 639 + */ 640 + kmemleak_ignore_percpu(tag->counters); 641 + } 638 642 return 0; 639 643 } 640 644
+8 -1
lib/group_cpus.c
··· 352 352 int ret = -ENOMEM; 353 353 struct cpumask *masks = NULL; 354 354 355 + if (numgrps == 0) 356 + return NULL; 357 + 355 358 if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL)) 356 359 return NULL; 357 360 ··· 429 426 #else /* CONFIG_SMP */ 430 427 struct cpumask *group_cpus_evenly(unsigned int numgrps) 431 428 { 432 - struct cpumask *masks = kcalloc(numgrps, sizeof(*masks), GFP_KERNEL); 429 + struct cpumask *masks; 433 430 431 + if (numgrps == 0) 432 + return NULL; 433 + 434 + masks = kcalloc(numgrps, sizeof(*masks), GFP_KERNEL); 434 435 if (!masks) 435 436 return NULL; 436 437
+1
mm/damon/sysfs-schemes.c
··· 472 472 return -ENOMEM; 473 473 474 474 strscpy(path, buf, count + 1); 475 + kfree(filter->memcg_path); 475 476 filter->memcg_path = path; 476 477 return count; 477 478 }
+17 -37
mm/hugetlb.c
··· 2787 2787 /* 2788 2788 * alloc_and_dissolve_hugetlb_folio - Allocate a new folio and dissolve 2789 2789 * the old one 2790 - * @h: struct hstate old page belongs to 2791 2790 * @old_folio: Old folio to dissolve 2792 2791 * @list: List to isolate the page in case we need to 2793 2792 * Returns 0 on success, otherwise negated error. 2794 2793 */ 2795 - static int alloc_and_dissolve_hugetlb_folio(struct hstate *h, 2796 - struct folio *old_folio, struct list_head *list) 2794 + static int alloc_and_dissolve_hugetlb_folio(struct folio *old_folio, 2795 + struct list_head *list) 2797 2796 { 2798 - gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE; 2797 + gfp_t gfp_mask; 2798 + struct hstate *h; 2799 2799 int nid = folio_nid(old_folio); 2800 2800 struct folio *new_folio = NULL; 2801 2801 int ret = 0; 2802 2802 2803 2803 retry: 2804 + /* 2805 + * The old_folio might have been dissolved from under our feet, so make sure 2806 + * to carefully check the state under the lock. 2807 + */ 2804 2808 spin_lock_irq(&hugetlb_lock); 2805 2809 if (!folio_test_hugetlb(old_folio)) { 2806 2810 /* ··· 2833 2829 cond_resched(); 2834 2830 goto retry; 2835 2831 } else { 2832 + h = folio_hstate(old_folio); 2836 2833 if (!new_folio) { 2837 2834 spin_unlock_irq(&hugetlb_lock); 2835 + gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE; 2838 2836 new_folio = alloc_buddy_hugetlb_folio(h, gfp_mask, nid, 2839 2837 NULL, NULL); 2840 2838 if (!new_folio) ··· 2880 2874 2881 2875 int isolate_or_dissolve_huge_folio(struct folio *folio, struct list_head *list) 2882 2876 { 2883 - struct hstate *h; 2884 2877 int ret = -EBUSY; 2885 2878 2886 - /* 2887 - * The page might have been dissolved from under our feet, so make sure 2888 - * to carefully check the state under the lock. 2889 - * Return success when racing as if we dissolved the page ourselves. 2890 - */ 2891 - spin_lock_irq(&hugetlb_lock); 2892 - if (folio_test_hugetlb(folio)) { 2893 - h = folio_hstate(folio); 2894 - } else { 2895 - spin_unlock_irq(&hugetlb_lock); 2879 + /* Not to disrupt normal path by vainly holding hugetlb_lock */ 2880 + if (!folio_test_hugetlb(folio)) 2896 2881 return 0; 2897 - } 2898 - spin_unlock_irq(&hugetlb_lock); 2899 2882 2900 2883 /* 2901 2884 * Fence off gigantic pages as there is a cyclic dependency between 2902 2885 * alloc_contig_range and them. Return -ENOMEM as this has the effect 2903 2886 * of bailing out right away without further retrying. 2904 2887 */ 2905 - if (hstate_is_gigantic(h)) 2888 + if (folio_order(folio) > MAX_PAGE_ORDER) 2906 2889 return -ENOMEM; 2907 2890 2908 2891 if (folio_ref_count(folio) && folio_isolate_hugetlb(folio, list)) 2909 2892 ret = 0; 2910 2893 else if (!folio_ref_count(folio)) 2911 - ret = alloc_and_dissolve_hugetlb_folio(h, folio, list); 2894 + ret = alloc_and_dissolve_hugetlb_folio(folio, list); 2912 2895 2913 2896 return ret; 2914 2897 } ··· 2911 2916 */ 2912 2917 int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn) 2913 2918 { 2914 - struct hstate *h; 2915 2919 struct folio *folio; 2916 2920 int ret = 0; 2917 2921 ··· 2919 2925 while (start_pfn < end_pfn) { 2920 2926 folio = pfn_folio(start_pfn); 2921 2927 2922 - /* 2923 - * The folio might have been dissolved from under our feet, so make sure 2924 - * to carefully check the state under the lock. 2925 - */ 2926 - spin_lock_irq(&hugetlb_lock); 2927 - if (folio_test_hugetlb(folio)) { 2928 - h = folio_hstate(folio); 2929 - } else { 2930 - spin_unlock_irq(&hugetlb_lock); 2931 - start_pfn++; 2932 - continue; 2933 - } 2934 - spin_unlock_irq(&hugetlb_lock); 2935 - 2936 - if (!folio_ref_count(folio)) { 2937 - ret = alloc_and_dissolve_hugetlb_folio(h, folio, 2938 - &isolate_list); 2928 + /* Not to disrupt normal path by vainly holding hugetlb_lock */ 2929 + if (folio_test_hugetlb(folio) && !folio_ref_count(folio)) { 2930 + ret = alloc_and_dissolve_hugetlb_folio(folio, &isolate_list); 2939 2931 if (ret) 2940 2932 break; 2941 2933
+14
mm/kmemleak.c
··· 1247 1247 EXPORT_SYMBOL(kmemleak_transient_leak); 1248 1248 1249 1249 /** 1250 + * kmemleak_ignore_percpu - similar to kmemleak_ignore but taking a percpu 1251 + * address argument 1252 + * @ptr: percpu address of the object 1253 + */ 1254 + void __ref kmemleak_ignore_percpu(const void __percpu *ptr) 1255 + { 1256 + pr_debug("%s(0x%px)\n", __func__, ptr); 1257 + 1258 + if (kmemleak_enabled && ptr && !IS_ERR_PCPU(ptr)) 1259 + make_black_object((unsigned long)ptr, OBJECT_PERCPU); 1260 + } 1261 + EXPORT_SYMBOL_GPL(kmemleak_ignore_percpu); 1262 + 1263 + /** 1250 1264 * kmemleak_ignore - ignore an allocated object 1251 1265 * @ptr: pointer to beginning of the object 1252 1266 *
+1 -1
scripts/gdb/linux/vfs.py
··· 22 22 if parent == d or parent == 0: 23 23 return "" 24 24 p = dentry_name(d['d_parent']) + "/" 25 - return p + d['d_iname'].string() 25 + return p + d['d_shortname']['string'].string() 26 26 27 27 class DentryName(gdb.Function): 28 28 """Return string of the full path of a dentry.
+5 -2
tools/testing/selftests/mm/virtual_address_range.c
··· 77 77 { 78 78 unsigned long addr = (unsigned long) ptr; 79 79 80 - if (high_addr && addr < HIGH_ADDR_MARK) 81 - ksft_exit_fail_msg("Bad address %lx\n", addr); 80 + if (high_addr) { 81 + if (addr < HIGH_ADDR_MARK) 82 + ksft_exit_fail_msg("Bad address %lx\n", addr); 83 + return; 84 + } 82 85 83 86 if (addr > HIGH_ADDR_MARK) 84 87 ksft_exit_fail_msg("Bad address %lx\n", addr);