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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mm-hotfixes-stable-2025-09-10-20-00' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
"20 hotfixes. 15 are cc:stable and the remainder address post-6.16
issues or aren't considered necessary for -stable kernels. 14 of these
fixes are for MM.

This includes

- kexec fixes from Breno for a recently introduced
use-uninitialized bug

- DAMON fixes from Quanmin Yan to avoid div-by-zero crashes
which can occur if the operator uses poorly-chosen insmod
parameters

and misc singleton fixes"

* tag 'mm-hotfixes-stable-2025-09-10-20-00' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
MAINTAINERS: add tree entry to numa memblocks and emulation block
mm/damon/sysfs: fix use-after-free in state_show()
proc: fix type confusion in pde_set_flags()
compiler-clang.h: define __SANITIZE_*__ macros only when undefined
mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc()
ocfs2: fix recursive semaphore deadlock in fiemap call
mm/memory-failure: fix VM_BUG_ON_PAGE(PagePoisoned(page)) when unpoison memory
mm/mremap: fix regression in vrm->new_addr check
percpu: fix race on alloc failed warning limit
mm/memory-failure: fix redundant updates for already poisoned pages
s390: kexec: initialize kexec_buf struct
riscv: kexec: initialize kexec_buf struct
arm64: kexec: initialize kexec_buf struct in load_other_segments()
mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters()
mm/damon/lru_sort: avoid divide-by-zero in damon_lru_sort_apply_parameters()
mm/damon/core: set quota->charged_from to jiffies at first charge window
mm/hugetlb: add missing hugetlb_lock in __unmap_hugepage_range()
init/main.c: fix boot time tracing crash
mm/memory_hotplug: fix hwpoisoned large folio handling in do_migrate_range()
mm/khugepaged: fix the address passed to notifier on testing young

+141 -63
+1
MAINTAINERS
··· 16128 16128 M: Mike Rapoport <rppt@kernel.org> 16129 16129 L: linux-mm@kvack.org 16130 16130 S: Maintained 16131 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git 16131 16132 F: include/linux/numa_memblks.h 16132 16133 F: mm/numa.c 16133 16134 F: mm/numa_emulation.c
+1 -1
arch/arm64/kernel/machine_kexec_file.c
··· 94 94 char *initrd, unsigned long initrd_len, 95 95 char *cmdline) 96 96 { 97 - struct kexec_buf kbuf; 97 + struct kexec_buf kbuf = {}; 98 98 void *dtb = NULL; 99 99 unsigned long initrd_load_addr = 0, dtb_len, 100 100 orig_segments = image->nr_segments;
+1 -1
arch/s390/kernel/kexec_elf.c
··· 16 16 static int kexec_file_add_kernel_elf(struct kimage *image, 17 17 struct s390_load_data *data) 18 18 { 19 - struct kexec_buf buf; 19 + struct kexec_buf buf = {}; 20 20 const Elf_Ehdr *ehdr; 21 21 const Elf_Phdr *phdr; 22 22 Elf_Addr entry;
+1 -1
arch/s390/kernel/kexec_image.c
··· 16 16 static int kexec_file_add_kernel_image(struct kimage *image, 17 17 struct s390_load_data *data) 18 18 { 19 - struct kexec_buf buf; 19 + struct kexec_buf buf = {}; 20 20 21 21 buf.image = image; 22 22
+3 -3
arch/s390/kernel/machine_kexec_file.c
··· 129 129 static int kexec_file_add_purgatory(struct kimage *image, 130 130 struct s390_load_data *data) 131 131 { 132 - struct kexec_buf buf; 132 + struct kexec_buf buf = {}; 133 133 int ret; 134 134 135 135 buf.image = image; ··· 152 152 static int kexec_file_add_initrd(struct kimage *image, 153 153 struct s390_load_data *data) 154 154 { 155 - struct kexec_buf buf; 155 + struct kexec_buf buf = {}; 156 156 int ret; 157 157 158 158 buf.image = image; ··· 184 184 { 185 185 __u32 *lc_ipl_parmblock_ptr; 186 186 unsigned int len, ncerts; 187 - struct kexec_buf buf; 187 + struct kexec_buf buf = {}; 188 188 unsigned long addr; 189 189 void *ptr, *end; 190 190 int ret;
+9 -1
fs/ocfs2/extent_map.c
··· 706 706 * it not only handles the fiemap for inlined files, but also deals 707 707 * with the fast symlink, cause they have no difference for extent 708 708 * mapping per se. 709 + * 710 + * Must be called with ip_alloc_sem semaphore held. 709 711 */ 710 712 static int ocfs2_fiemap_inline(struct inode *inode, struct buffer_head *di_bh, 711 713 struct fiemap_extent_info *fieinfo, ··· 719 717 u64 phys; 720 718 u32 flags = FIEMAP_EXTENT_DATA_INLINE|FIEMAP_EXTENT_LAST; 721 719 struct ocfs2_inode_info *oi = OCFS2_I(inode); 720 + lockdep_assert_held_read(&oi->ip_alloc_sem); 722 721 723 722 di = (struct ocfs2_dinode *)di_bh->b_data; 724 723 if (ocfs2_inode_is_fast_symlink(inode)) ··· 735 732 phys += offsetof(struct ocfs2_dinode, 736 733 id2.i_data.id_data); 737 734 735 + /* Release the ip_alloc_sem to prevent deadlock on page fault */ 736 + up_read(&OCFS2_I(inode)->ip_alloc_sem); 738 737 ret = fiemap_fill_next_extent(fieinfo, 0, phys, id_count, 739 738 flags); 739 + down_read(&OCFS2_I(inode)->ip_alloc_sem); 740 740 if (ret < 0) 741 741 return ret; 742 742 } ··· 808 802 len_bytes = (u64)le16_to_cpu(rec.e_leaf_clusters) << osb->s_clustersize_bits; 809 803 phys_bytes = le64_to_cpu(rec.e_blkno) << osb->sb->s_blocksize_bits; 810 804 virt_bytes = (u64)le32_to_cpu(rec.e_cpos) << osb->s_clustersize_bits; 811 - 805 + /* Release the ip_alloc_sem to prevent deadlock on page fault */ 806 + up_read(&OCFS2_I(inode)->ip_alloc_sem); 812 807 ret = fiemap_fill_next_extent(fieinfo, virt_bytes, phys_bytes, 813 808 len_bytes, fe_flags); 809 + down_read(&OCFS2_I(inode)->ip_alloc_sem); 814 810 if (ret) 815 811 break; 816 812
+2 -1
fs/proc/generic.c
··· 393 393 if (proc_alloc_inum(&dp->low_ino)) 394 394 goto out_free_entry; 395 395 396 - pde_set_flags(dp); 396 + if (!S_ISDIR(dp->mode)) 397 + pde_set_flags(dp); 397 398 398 399 write_lock(&proc_subdir_lock); 399 400 dp->parent = dir;
+25 -6
include/linux/compiler-clang.h
··· 18 18 #define KASAN_ABI_VERSION 5 19 19 20 20 /* 21 + * Clang 22 added preprocessor macros to match GCC, in hopes of eventually 22 + * dropping __has_feature support for sanitizers: 23 + * https://github.com/llvm/llvm-project/commit/568c23bbd3303518c5056d7f03444dae4fdc8a9c 24 + * Create these macros for older versions of clang so that it is easy to clean 25 + * up once the minimum supported version of LLVM for building the kernel always 26 + * creates these macros. 27 + * 21 28 * Note: Checking __has_feature(*_sanitizer) is only true if the feature is 22 29 * enabled. Therefore it is not required to additionally check defined(CONFIG_*) 23 30 * to avoid adding redundant attributes in other configurations. 24 31 */ 25 - 26 - #if __has_feature(address_sanitizer) || __has_feature(hwaddress_sanitizer) 27 - /* Emulate GCC's __SANITIZE_ADDRESS__ flag */ 32 + #if __has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__) 28 33 #define __SANITIZE_ADDRESS__ 34 + #endif 35 + #if __has_feature(hwaddress_sanitizer) && !defined(__SANITIZE_HWADDRESS__) 36 + #define __SANITIZE_HWADDRESS__ 37 + #endif 38 + #if __has_feature(thread_sanitizer) && !defined(__SANITIZE_THREAD__) 39 + #define __SANITIZE_THREAD__ 40 + #endif 41 + 42 + /* 43 + * Treat __SANITIZE_HWADDRESS__ the same as __SANITIZE_ADDRESS__ in the kernel. 44 + */ 45 + #ifdef __SANITIZE_HWADDRESS__ 46 + #define __SANITIZE_ADDRESS__ 47 + #endif 48 + 49 + #ifdef __SANITIZE_ADDRESS__ 29 50 #define __no_sanitize_address \ 30 51 __attribute__((no_sanitize("address", "hwaddress"))) 31 52 #else 32 53 #define __no_sanitize_address 33 54 #endif 34 55 35 - #if __has_feature(thread_sanitizer) 36 - /* emulate gcc's __SANITIZE_THREAD__ flag */ 37 - #define __SANITIZE_THREAD__ 56 + #ifdef __SANITIZE_THREAD__ 38 57 #define __no_sanitize_thread \ 39 58 __attribute__((no_sanitize("thread"))) 40 59 #else
+3 -3
include/linux/kasan.h
··· 562 562 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS) 563 563 564 564 void kasan_populate_early_vm_area_shadow(void *start, unsigned long size); 565 - int kasan_populate_vmalloc(unsigned long addr, unsigned long size); 565 + int kasan_populate_vmalloc(unsigned long addr, unsigned long size, gfp_t gfp_mask); 566 566 void kasan_release_vmalloc(unsigned long start, unsigned long end, 567 567 unsigned long free_region_start, 568 568 unsigned long free_region_end, ··· 574 574 unsigned long size) 575 575 { } 576 576 static inline int kasan_populate_vmalloc(unsigned long start, 577 - unsigned long size) 577 + unsigned long size, gfp_t gfp_mask) 578 578 { 579 579 return 0; 580 580 } ··· 610 610 static inline void kasan_populate_early_vm_area_shadow(void *start, 611 611 unsigned long size) { } 612 612 static inline int kasan_populate_vmalloc(unsigned long start, 613 - unsigned long size) 613 + unsigned long size, gfp_t gfp_mask) 614 614 { 615 615 return 0; 616 616 }
+1 -1
init/main.c
··· 956 956 sort_main_extable(); 957 957 trap_init(); 958 958 mm_core_init(); 959 + maple_tree_init(); 959 960 poking_init(); 960 961 ftrace_init(); 961 962 ··· 974 973 "Interrupts were enabled *very* early, fixing it\n")) 975 974 local_irq_disable(); 976 975 radix_tree_init(); 977 - maple_tree_init(); 978 976 979 977 /* 980 978 * Set up housekeeping before setting up workqueues to allow the unbound
+4
mm/damon/core.c
··· 2111 2111 if (!quota->ms && !quota->sz && list_empty(&quota->goals)) 2112 2112 return; 2113 2113 2114 + /* First charge window */ 2115 + if (!quota->total_charged_sz && !quota->charged_from) 2116 + quota->charged_from = jiffies; 2117 + 2114 2118 /* New charge window starts */ 2115 2119 if (time_after_eq(jiffies, quota->charged_from + 2116 2120 msecs_to_jiffies(quota->reset_interval))) {
+5
mm/damon/lru_sort.c
··· 198 198 if (err) 199 199 return err; 200 200 201 + if (!damon_lru_sort_mon_attrs.sample_interval) { 202 + err = -EINVAL; 203 + goto out; 204 + } 205 + 201 206 err = damon_set_attrs(ctx, &damon_lru_sort_mon_attrs); 202 207 if (err) 203 208 goto out;
+5
mm/damon/reclaim.c
··· 194 194 if (err) 195 195 return err; 196 196 197 + if (!damon_reclaim_mon_attrs.aggr_interval) { 198 + err = -EINVAL; 199 + goto out; 200 + } 201 + 197 202 err = damon_set_attrs(param_ctx, &damon_reclaim_mon_attrs); 198 203 if (err) 199 204 goto out;
+9 -5
mm/damon/sysfs.c
··· 1260 1260 { 1261 1261 struct damon_sysfs_kdamond *kdamond = container_of(kobj, 1262 1262 struct damon_sysfs_kdamond, kobj); 1263 - struct damon_ctx *ctx = kdamond->damon_ctx; 1264 - bool running; 1263 + struct damon_ctx *ctx; 1264 + bool running = false; 1265 1265 1266 - if (!ctx) 1267 - running = false; 1268 - else 1266 + if (!mutex_trylock(&damon_sysfs_lock)) 1267 + return -EBUSY; 1268 + 1269 + ctx = kdamond->damon_ctx; 1270 + if (ctx) 1269 1271 running = damon_is_running(ctx); 1272 + 1273 + mutex_unlock(&damon_sysfs_lock); 1270 1274 1271 1275 return sysfs_emit(buf, "%s\n", running ? 1272 1276 damon_sysfs_cmd_strs[DAMON_SYSFS_CMD_ON] :
+6 -3
mm/hugetlb.c
··· 5851 5851 spinlock_t *ptl; 5852 5852 struct hstate *h = hstate_vma(vma); 5853 5853 unsigned long sz = huge_page_size(h); 5854 - bool adjust_reservation = false; 5854 + bool adjust_reservation; 5855 5855 unsigned long last_addr_mask; 5856 5856 bool force_flush = false; 5857 5857 ··· 5944 5944 sz); 5945 5945 hugetlb_count_sub(pages_per_huge_page(h), mm); 5946 5946 hugetlb_remove_rmap(folio); 5947 + spin_unlock(ptl); 5947 5948 5948 5949 /* 5949 5950 * Restore the reservation for anonymous page, otherwise the ··· 5952 5951 * If there we are freeing a surplus, do not set the restore 5953 5952 * reservation bit. 5954 5953 */ 5954 + adjust_reservation = false; 5955 + 5956 + spin_lock_irq(&hugetlb_lock); 5955 5957 if (!h->surplus_huge_pages && __vma_private_lock(vma) && 5956 5958 folio_test_anon(folio)) { 5957 5959 folio_set_hugetlb_restore_reserve(folio); 5958 5960 /* Reservation to be adjusted after the spin lock */ 5959 5961 adjust_reservation = true; 5960 5962 } 5961 - 5962 - spin_unlock(ptl); 5963 + spin_unlock_irq(&hugetlb_lock); 5963 5964 5964 5965 /* 5965 5966 * Adjust the reservation for the region that will have the
+24 -7
mm/kasan/shadow.c
··· 336 336 } 337 337 } 338 338 339 - static int ___alloc_pages_bulk(struct page **pages, int nr_pages) 339 + static int ___alloc_pages_bulk(struct page **pages, int nr_pages, gfp_t gfp_mask) 340 340 { 341 341 unsigned long nr_populated, nr_total = nr_pages; 342 342 struct page **page_array = pages; 343 343 344 344 while (nr_pages) { 345 - nr_populated = alloc_pages_bulk(GFP_KERNEL, nr_pages, pages); 345 + nr_populated = alloc_pages_bulk(gfp_mask, nr_pages, pages); 346 346 if (!nr_populated) { 347 347 ___free_pages_bulk(page_array, nr_total - nr_pages); 348 348 return -ENOMEM; ··· 354 354 return 0; 355 355 } 356 356 357 - static int __kasan_populate_vmalloc(unsigned long start, unsigned long end) 357 + static int __kasan_populate_vmalloc(unsigned long start, unsigned long end, gfp_t gfp_mask) 358 358 { 359 359 unsigned long nr_pages, nr_total = PFN_UP(end - start); 360 360 struct vmalloc_populate_data data; 361 + unsigned int flags; 361 362 int ret = 0; 362 363 363 - data.pages = (struct page **)__get_free_page(GFP_KERNEL | __GFP_ZERO); 364 + data.pages = (struct page **)__get_free_page(gfp_mask | __GFP_ZERO); 364 365 if (!data.pages) 365 366 return -ENOMEM; 366 367 367 368 while (nr_total) { 368 369 nr_pages = min(nr_total, PAGE_SIZE / sizeof(data.pages[0])); 369 - ret = ___alloc_pages_bulk(data.pages, nr_pages); 370 + ret = ___alloc_pages_bulk(data.pages, nr_pages, gfp_mask); 370 371 if (ret) 371 372 break; 372 373 373 374 data.start = start; 375 + 376 + /* 377 + * page tables allocations ignore external gfp mask, enforce it 378 + * by the scope API 379 + */ 380 + if ((gfp_mask & (__GFP_FS | __GFP_IO)) == __GFP_IO) 381 + flags = memalloc_nofs_save(); 382 + else if ((gfp_mask & (__GFP_FS | __GFP_IO)) == 0) 383 + flags = memalloc_noio_save(); 384 + 374 385 ret = apply_to_page_range(&init_mm, start, nr_pages * PAGE_SIZE, 375 386 kasan_populate_vmalloc_pte, &data); 387 + 388 + if ((gfp_mask & (__GFP_FS | __GFP_IO)) == __GFP_IO) 389 + memalloc_nofs_restore(flags); 390 + else if ((gfp_mask & (__GFP_FS | __GFP_IO)) == 0) 391 + memalloc_noio_restore(flags); 392 + 376 393 ___free_pages_bulk(data.pages, nr_pages); 377 394 if (ret) 378 395 break; ··· 403 386 return ret; 404 387 } 405 388 406 - int kasan_populate_vmalloc(unsigned long addr, unsigned long size) 389 + int kasan_populate_vmalloc(unsigned long addr, unsigned long size, gfp_t gfp_mask) 407 390 { 408 391 unsigned long shadow_start, shadow_end; 409 392 int ret; ··· 432 415 shadow_start = PAGE_ALIGN_DOWN(shadow_start); 433 416 shadow_end = PAGE_ALIGN(shadow_end); 434 417 435 - ret = __kasan_populate_vmalloc(shadow_start, shadow_end); 418 + ret = __kasan_populate_vmalloc(shadow_start, shadow_end, gfp_mask); 436 419 if (ret) 437 420 return ret; 438 421
+2 -2
mm/khugepaged.c
··· 1417 1417 */ 1418 1418 if (cc->is_khugepaged && 1419 1419 (pte_young(pteval) || folio_test_young(folio) || 1420 - folio_test_referenced(folio) || mmu_notifier_test_young(vma->vm_mm, 1421 - address))) 1420 + folio_test_referenced(folio) || 1421 + mmu_notifier_test_young(vma->vm_mm, _address))) 1422 1422 referenced++; 1423 1423 } 1424 1424 if (!writable) {
+9 -11
mm/memory-failure.c
··· 956 956 [MF_MSG_BUDDY] = "free buddy page", 957 957 [MF_MSG_DAX] = "dax page", 958 958 [MF_MSG_UNSPLIT_THP] = "unsplit thp", 959 - [MF_MSG_ALREADY_POISONED] = "already poisoned", 959 + [MF_MSG_ALREADY_POISONED] = "already poisoned page", 960 960 [MF_MSG_UNKNOWN] = "unknown page", 961 961 }; 962 962 ··· 1349 1349 { 1350 1350 trace_memory_failure_event(pfn, type, result); 1351 1351 1352 - num_poisoned_pages_inc(pfn); 1353 - 1354 - update_per_node_mf_stats(pfn, result); 1352 + if (type != MF_MSG_ALREADY_POISONED) { 1353 + num_poisoned_pages_inc(pfn); 1354 + update_per_node_mf_stats(pfn, result); 1355 + } 1355 1356 1356 1357 pr_err("%#lx: recovery action for %s: %s\n", 1357 1358 pfn, action_page_types[type], action_name[result]); ··· 2095 2094 *hugetlb = 0; 2096 2095 return 0; 2097 2096 } else if (res == -EHWPOISON) { 2098 - pr_err("%#lx: already hardware poisoned\n", pfn); 2099 2097 if (flags & MF_ACTION_REQUIRED) { 2100 2098 folio = page_folio(p); 2101 2099 res = kill_accessing_process(current, folio_pfn(folio), flags); 2102 - action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2103 2100 } 2101 + action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2104 2102 return res; 2105 2103 } else if (res == -EBUSY) { 2106 2104 if (!(flags & MF_NO_RETRY)) { ··· 2285 2285 goto unlock_mutex; 2286 2286 2287 2287 if (TestSetPageHWPoison(p)) { 2288 - pr_err("%#lx: already hardware poisoned\n", pfn); 2289 2288 res = -EHWPOISON; 2290 2289 if (flags & MF_ACTION_REQUIRED) 2291 2290 res = kill_accessing_process(current, pfn, flags); ··· 2568 2569 static DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL, 2569 2570 DEFAULT_RATELIMIT_BURST); 2570 2571 2571 - if (!pfn_valid(pfn)) 2572 - return -ENXIO; 2573 - 2574 - p = pfn_to_page(pfn); 2572 + p = pfn_to_online_page(pfn); 2573 + if (!p) 2574 + return -EIO; 2575 2575 folio = page_folio(p); 2576 2576 2577 2577 mutex_lock(&mf_mutex);
+8 -2
mm/memory_hotplug.c
··· 1815 1815 pfn = folio_pfn(folio) + folio_nr_pages(folio) - 1; 1816 1816 1817 1817 if (folio_contain_hwpoisoned_page(folio)) { 1818 - if (WARN_ON(folio_test_lru(folio))) 1819 - folio_isolate_lru(folio); 1818 + /* 1819 + * unmap_poisoned_folio() cannot handle large folios 1820 + * in all cases yet. 1821 + */ 1822 + if (folio_test_large(folio) && !folio_test_hugetlb(folio)) 1823 + goto put_folio; 1824 + if (folio_test_lru(folio) && !folio_isolate_lru(folio)) 1825 + goto put_folio; 1820 1826 if (folio_mapped(folio)) { 1821 1827 folio_lock(folio); 1822 1828 unmap_poisoned_folio(folio, pfn, false);
+6 -3
mm/mremap.c
··· 1774 1774 if (!vrm->new_len) 1775 1775 return -EINVAL; 1776 1776 1777 - /* Is the new length or address silly? */ 1778 - if (vrm->new_len > TASK_SIZE || 1779 - vrm->new_addr > TASK_SIZE - vrm->new_len) 1777 + /* Is the new length silly? */ 1778 + if (vrm->new_len > TASK_SIZE) 1780 1779 return -EINVAL; 1781 1780 1782 1781 /* Remainder of checks are for cases with specific new_addr. */ 1783 1782 if (!vrm_implies_new_addr(vrm)) 1784 1783 return 0; 1784 + 1785 + /* Is the new address silly? */ 1786 + if (vrm->new_addr > TASK_SIZE - vrm->new_len) 1787 + return -EINVAL; 1785 1788 1786 1789 /* The new address must be page-aligned. */ 1787 1790 if (offset_in_page(vrm->new_addr))
+12 -8
mm/percpu.c
··· 1734 1734 bool is_atomic; 1735 1735 bool do_warn; 1736 1736 struct obj_cgroup *objcg = NULL; 1737 - static int warn_limit = 10; 1737 + static atomic_t warn_limit = ATOMIC_INIT(10); 1738 1738 struct pcpu_chunk *chunk, *next; 1739 1739 const char *err; 1740 1740 int slot, off, cpu, ret; ··· 1904 1904 fail: 1905 1905 trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align); 1906 1906 1907 - if (do_warn && warn_limit) { 1908 - pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n", 1909 - size, align, is_atomic, err); 1910 - if (!is_atomic) 1911 - dump_stack(); 1912 - if (!--warn_limit) 1913 - pr_info("limit reached, disable warning\n"); 1907 + if (do_warn) { 1908 + int remaining = atomic_dec_if_positive(&warn_limit); 1909 + 1910 + if (remaining >= 0) { 1911 + pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n", 1912 + size, align, is_atomic, err); 1913 + if (!is_atomic) 1914 + dump_stack(); 1915 + if (remaining == 0) 1916 + pr_info("limit reached, disable warning\n"); 1917 + } 1914 1918 } 1915 1919 1916 1920 if (is_atomic) {
+4 -4
mm/vmalloc.c
··· 2026 2026 if (unlikely(!vmap_initialized)) 2027 2027 return ERR_PTR(-EBUSY); 2028 2028 2029 + /* Only reclaim behaviour flags are relevant. */ 2030 + gfp_mask = gfp_mask & GFP_RECLAIM_MASK; 2029 2031 might_sleep(); 2030 2032 2031 2033 /* ··· 2040 2038 */ 2041 2039 va = node_alloc(size, align, vstart, vend, &addr, &vn_id); 2042 2040 if (!va) { 2043 - gfp_mask = gfp_mask & GFP_RECLAIM_MASK; 2044 - 2045 2041 va = kmem_cache_alloc_node(vmap_area_cachep, gfp_mask, node); 2046 2042 if (unlikely(!va)) 2047 2043 return ERR_PTR(-ENOMEM); ··· 2089 2089 BUG_ON(va->va_start < vstart); 2090 2090 BUG_ON(va->va_end > vend); 2091 2091 2092 - ret = kasan_populate_vmalloc(addr, size); 2092 + ret = kasan_populate_vmalloc(addr, size, gfp_mask); 2093 2093 if (ret) { 2094 2094 free_vmap_area(va); 2095 2095 return ERR_PTR(ret); ··· 4826 4826 4827 4827 /* populate the kasan shadow space */ 4828 4828 for (area = 0; area < nr_vms; area++) { 4829 - if (kasan_populate_vmalloc(vas[area]->va_start, sizes[area])) 4829 + if (kasan_populate_vmalloc(vas[area]->va_start, sizes[area], GFP_KERNEL)) 4830 4830 goto err_free_shadow; 4831 4831 } 4832 4832