Skip to content

Commit bcb6058

Browse files
committed
Merge tag 'mm-hotfixes-stable-2026-01-29-09-41' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "16 hotfixes. 9 are cc:stable, 12 are for MM. There's a patch series from Pratyush Yadav which fixes a few things in the new-in-6.19 LUO memfd code. Plus the usual shower of singletons - please see the changelogs for details" * tag 'mm-hotfixes-stable-2026-01-29-09-41' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: vmcoreinfo: make hwerr_data visible for debugging mm/zone_device: reinitialize large zone device private folios mm/mm_init: don't cond_resched() in deferred_init_memmap_chunk() if called from deferred_grow_zone() mm/kfence: randomize the freelist on initialization kho: kho_preserve_vmalloc(): don't return 0 when ENOMEM kho: init alloc tags when restoring pages from reserved memory mm: memfd_luo: restore and free memfd_luo_ser on failure mm: memfd_luo: use memfd_alloc_file() instead of shmem_file_setup() memfd: export alloc_file() flex_proportions: make fprop_new_period() hardirq safe mailmap: add entry for Viacheslav Bocharov mm/memory-failure: teach kill_accessing_process to accept hugetlb tail page pfn mm/memory-failure: fix missing ->mf_stats count in hugetlb poison mm, swap: restore swap_space attr aviod kernel panic mm/kasan: fix KASAN poisoning in vrealloc() mm/shmem, swap: fix race of truncate and swap entry split
2 parents 1cac389 + bd58782 commit bcb6058

23 files changed

Lines changed: 239 additions & 87 deletions

File tree

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ Valentin Schneider <vschneid@redhat.com> <valentin.schneider@arm.com>
851851
Veera Sundaram Sankaran <quic_veeras@quicinc.com> <veeras@codeaurora.org>
852852
Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com> <vbadigan@codeaurora.org>
853853
Venkateswara Naralasetty <quic_vnaralas@quicinc.com> <vnaralas@codeaurora.org>
854+
Viacheslav Bocharov <v@baodeep.com> <adeep@lexina.in>
854855
Vikash Garodia <vikash.garodia@oss.qualcomm.com> <vgarodia@codeaurora.org>
855856
Vikash Garodia <vikash.garodia@oss.qualcomm.com> <quic_vgarodia@quicinc.com>
856857
Vincent Mailhol <mailhol@kernel.org> <mailhol.vincent@wanadoo.fr>

arch/powerpc/kvm/book3s_hv_uvmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm)
723723

724724
dpage = pfn_to_page(uvmem_pfn);
725725
dpage->zone_device_data = pvt;
726-
zone_device_page_init(dpage, 0);
726+
zone_device_page_init(dpage, &kvmppc_uvmem_pgmap, 0);
727727
return dpage;
728728
out_clear:
729729
spin_lock(&kvmppc_uvmem_bitmap_lock);

drivers/gpu/drm/amd/amdkfd/kfd_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ svm_migrate_get_vram_page(struct svm_range *prange, unsigned long pfn)
217217
page = pfn_to_page(pfn);
218218
svm_range_bo_ref(prange->svm_bo);
219219
page->zone_device_data = prange->svm_bo;
220-
zone_device_page_init(page, 0);
220+
zone_device_page_init(page, page_pgmap(page), 0);
221221
}
222222

223223
static void

drivers/gpu/drm/drm_pagemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void drm_pagemap_get_devmem_page(struct page *page,
197197
struct drm_pagemap_zdd *zdd)
198198
{
199199
page->zone_device_data = drm_pagemap_zdd_get(zdd);
200-
zone_device_page_init(page, 0);
200+
zone_device_page_init(page, page_pgmap(page), 0);
201201
}
202202

203203
/**

drivers/gpu/drm/nouveau/nouveau_dmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ nouveau_dmem_page_alloc_locked(struct nouveau_drm *drm, bool is_large)
425425
order = ilog2(DMEM_CHUNK_NPAGES);
426426
}
427427

428-
zone_device_folio_init(folio, order);
428+
zone_device_folio_init(folio, page_pgmap(folio_page(folio, 0)), order);
429429
return page;
430430
}
431431

include/linux/kasan.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,17 @@ kasan_unpoison_vmap_areas(struct vm_struct **vms, int nr_vms,
641641
__kasan_unpoison_vmap_areas(vms, nr_vms, flags);
642642
}
643643

644+
void __kasan_vrealloc(const void *start, unsigned long old_size,
645+
unsigned long new_size);
646+
647+
static __always_inline void kasan_vrealloc(const void *start,
648+
unsigned long old_size,
649+
unsigned long new_size)
650+
{
651+
if (kasan_enabled())
652+
__kasan_vrealloc(start, old_size, new_size);
653+
}
654+
644655
#else /* CONFIG_KASAN_VMALLOC */
645656

646657
static inline void kasan_populate_early_vm_area_shadow(void *start,
@@ -670,6 +681,9 @@ kasan_unpoison_vmap_areas(struct vm_struct **vms, int nr_vms,
670681
kasan_vmalloc_flags_t flags)
671682
{ }
672683

684+
static inline void kasan_vrealloc(const void *start, unsigned long old_size,
685+
unsigned long new_size) { }
686+
673687
#endif /* CONFIG_KASAN_VMALLOC */
674688

675689
#if (defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)) && \

include/linux/memfd.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
1717
* to by vm_flags_ptr.
1818
*/
1919
int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr);
20+
struct file *memfd_alloc_file(const char *name, unsigned int flags);
2021
#else
2122
static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a)
2223
{
@@ -31,6 +32,11 @@ static inline int memfd_check_seals_mmap(struct file *file,
3132
{
3233
return 0;
3334
}
35+
36+
static inline struct file *memfd_alloc_file(const char *name, unsigned int flags)
37+
{
38+
return ERR_PTR(-EINVAL);
39+
}
3440
#endif
3541

3642
#endif /* __LINUX_MEMFD_H */

include/linux/memremap.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ static inline bool is_fsdax_page(const struct page *page)
224224
}
225225

226226
#ifdef CONFIG_ZONE_DEVICE
227-
void zone_device_page_init(struct page *page, unsigned int order);
227+
void zone_device_page_init(struct page *page, struct dev_pagemap *pgmap,
228+
unsigned int order);
228229
void *memremap_pages(struct dev_pagemap *pgmap, int nid);
229230
void memunmap_pages(struct dev_pagemap *pgmap);
230231
void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
@@ -234,9 +235,11 @@ bool pgmap_pfn_valid(struct dev_pagemap *pgmap, unsigned long pfn);
234235

235236
unsigned long memremap_compat_align(void);
236237

237-
static inline void zone_device_folio_init(struct folio *folio, unsigned int order)
238+
static inline void zone_device_folio_init(struct folio *folio,
239+
struct dev_pagemap *pgmap,
240+
unsigned int order)
238241
{
239-
zone_device_page_init(&folio->page, order);
242+
zone_device_page_init(&folio->page, pgmap, order);
240243
if (order)
241244
folio_set_large_rmappable(folio);
242245
}

kernel/liveupdate/kexec_handover.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ static struct page *kho_restore_page(phys_addr_t phys, bool is_folio)
255255
if (is_folio && info.order)
256256
prep_compound_page(page, info.order);
257257

258+
/* Always mark headpage's codetag as empty to avoid accounting mismatch */
259+
clear_page_tag_ref(page);
260+
if (!is_folio) {
261+
/* Also do that for the non-compound tail pages */
262+
for (unsigned int i = 1; i < nr_pages; i++)
263+
clear_page_tag_ref(page + i);
264+
}
265+
258266
adjust_managed_page_count(page, nr_pages);
259267
return page;
260268
}
@@ -1006,8 +1014,10 @@ int kho_preserve_vmalloc(void *ptr, struct kho_vmalloc *preservation)
10061014
chunk->phys[idx++] = phys;
10071015
if (idx == ARRAY_SIZE(chunk->phys)) {
10081016
chunk = new_vmalloc_chunk(chunk);
1009-
if (!chunk)
1017+
if (!chunk) {
1018+
err = -ENOMEM;
10101019
goto err_free;
1020+
}
10111021
idx = 0;
10121022
}
10131023
}

kernel/vmcore_info.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ struct hwerr_info {
3636
time64_t timestamp;
3737
};
3838

39-
static struct hwerr_info hwerr_data[HWERR_RECOV_MAX];
39+
/*
40+
* The hwerr_data[] array is declared with global scope so that it remains
41+
* accessible to vmcoreinfo even when Link Time Optimization (LTO) is enabled.
42+
*/
43+
struct hwerr_info hwerr_data[HWERR_RECOV_MAX];
4044

4145
Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type,
4246
void *data, size_t data_len)

0 commit comments

Comments
 (0)