Skip to content

Commit 7f5e47f

Browse files
committed
Merge tag 'mm-hotfixes-stable-2024-01-12-16-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc hotfixes from Andrew Morton: "For once not mostly MM-related. 17 hotfixes. 10 address post-6.7 issues and the other 7 are cc:stable" * tag 'mm-hotfixes-stable-2024-01-12-16-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: userfaultfd: avoid huge_zero_page in UFFDIO_MOVE MAINTAINERS: add entry for shrinker selftests: mm: hugepage-vmemmap fails on 64K page size systems mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval mailmap: switch email for Tanzir Hasan mailmap: add old address mappings for Randy kernel/crash_core.c: make __crash_hotplug_lock static efi: disable mirror feature during crashkernel kexec: do syscore_shutdown() in kernel_kexec mailmap: update entry for Manivannan Sadhasivam fs/proc/task_mmu: move mmu notification mechanism inside mm lock mm: zswap: switch maintainers to recently active developers and reviewers scripts/decode_stacktrace.sh: optionally use LLVM utilities kasan: avoid resetting aux_lock lib/Kconfig.debug: disable CONFIG_DEBUG_INFO_BTF for Hexagon MAINTAINERS: update LTP maintainers kdump: defer the insertion of crashkernel resources
2 parents 052d534 + 5d4747a commit 7f5e47f

12 files changed

Lines changed: 114 additions & 40 deletions

File tree

.mailmap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ Maheshwar Ajja <quic_majja@quicinc.com> <majja@codeaurora.org>
363363
Malathi Gottam <quic_mgottam@quicinc.com> <mgottam@codeaurora.org>
364364
Manikanta Pubbisetty <quic_mpubbise@quicinc.com> <mpubbise@codeaurora.org>
365365
Manivannan Sadhasivam <mani@kernel.org> <manivannanece23@gmail.com>
366-
Manivannan Sadhasivam <mani@kernel.org> <manivannan.sadhasivam@linaro.org>
367366
Manoj Basapathi <quic_manojbm@quicinc.com> <manojbm@codeaurora.org>
368367
Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com>
369368
Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com>
@@ -504,6 +503,9 @@ Ralf Baechle <ralf@linux-mips.org>
504503
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
505504
Ram Chandra Jangir <quic_rjangir@quicinc.com> <rjangir@codeaurora.org>
506505
Randy Dunlap <rdunlap@infradead.org> <rdunlap@xenotime.net>
506+
Randy Dunlap <rdunlap@infradead.org> <randy.dunlap@oracle.com>
507+
Randy Dunlap <rdunlap@infradead.org> <rddunlap@osdl.org>
508+
Randy Dunlap <rdunlap@infradead.org> <randy.dunlap@intel.com>
507509
Ravi Kumar Bokka <quic_rbokka@quicinc.com> <rbokka@codeaurora.org>
508510
Ravi Kumar Siddojigari <quic_rsiddoji@quicinc.com> <rsiddoji@codeaurora.org>
509511
Rémi Denis-Courmont <rdenis@simphalempin.com>
@@ -582,6 +584,7 @@ Surabhi Vishnoi <quic_svishnoi@quicinc.com> <svishnoi@codeaurora.org>
582584
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
583585
Tamizh Chelvam Raja <quic_tamizhr@quicinc.com> <tamizhr@codeaurora.org>
584586
Taniya Das <quic_tdas@quicinc.com> <tdas@codeaurora.org>
587+
Tanzir Hasan <tanzhasanwork@gmail.com> <tanzirh@google.com>
585588
Tejun Heo <htejun@gmail.com>
586589
Tomeu Vizoso <tomeu@tomeuvizoso.net> <tomeu.vizoso@collabora.com>
587590
Thomas Graf <tgraf@suug.ch>

MAINTAINERS

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12724,12 +12724,11 @@ F: Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
1272412724
F: drivers/i2c/muxes/i2c-mux-ltc4306.c
1272512725

1272612726
LTP (Linux Test Project)
12727-
M: Mike Frysinger <vapier@gentoo.org>
1272812727
M: Cyril Hrubis <chrubis@suse.cz>
12729-
M: Wanlong Gao <wanlong.gao@gmail.com>
1273012728
M: Jan Stancek <jstancek@redhat.com>
12731-
M: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
12732-
M: Alexey Kodanev <alexey.kodanev@oracle.com>
12729+
M: Petr Vorel <pvorel@suse.cz>
12730+
M: Li Wang <liwang@redhat.com>
12731+
M: Yang Xu <xuyang2018.jy@fujitsu.com>
1273312732
L: ltp@lists.linux.it (subscribers-only)
1273412733
S: Maintained
1273512734
W: http://linux-test-project.github.io/
@@ -19738,6 +19737,19 @@ T: git git://linuxtv.org/media_tree.git
1973819737
F: drivers/media/i2c/rj54n1cb0c.c
1973919738
F: include/media/i2c/rj54n1cb0c.h
1974019739

19740+
SHRINKER
19741+
M: Andrew Morton <akpm@linux-foundation.org>
19742+
M: Dave Chinner <david@fromorbit.com>
19743+
R: Qi Zheng <zhengqi.arch@bytedance.com>
19744+
R: Roman Gushchin <roman.gushchin@linux.dev>
19745+
R: Muchun Song <muchun.song@linux.dev>
19746+
L: linux-mm@kvack.org
19747+
S: Maintained
19748+
F: Documentation/admin-guide/mm/shrinker_debugfs.rst
19749+
F: include/linux/shrinker.h
19750+
F: mm/shrinker.c
19751+
F: mm/shrinker_debug.c
19752+
1974119753
SH_VOU V4L2 OUTPUT DRIVER
1974219754
L: linux-media@vger.kernel.org
1974319755
S: Orphan
@@ -24263,11 +24275,13 @@ N: zstd
2426324275
K: zstd
2426424276

2426524277
ZSWAP COMPRESSED SWAP CACHING
24266-
M: Seth Jennings <sjenning@redhat.com>
24267-
M: Dan Streetman <ddstreet@ieee.org>
24268-
M: Vitaly Wool <vitaly.wool@konsulko.com>
24278+
M: Johannes Weiner <hannes@cmpxchg.org>
24279+
M: Yosry Ahmed <yosryahmed@google.com>
24280+
M: Nhat Pham <nphamcs@gmail.com>
2426924281
L: linux-mm@kvack.org
2427024282
S: Maintained
24283+
F: Documentation/admin-guide/mm/zswap.rst
24284+
F: include/linux/zswap.h
2427124285
F: mm/zswap.c
2427224286

2427324287
THE REST

fs/proc/task_mmu.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,6 @@ static long pagemap_scan_flush_buffer(struct pagemap_scan_private *p)
24322432

24332433
static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
24342434
{
2435-
struct mmu_notifier_range range;
24362435
struct pagemap_scan_private p = {0};
24372436
unsigned long walk_start;
24382437
size_t n_ranges_out = 0;
@@ -2448,15 +2447,9 @@ static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
24482447
if (ret)
24492448
return ret;
24502449

2451-
/* Protection change for the range is going to happen. */
2452-
if (p.arg.flags & PM_SCAN_WP_MATCHING) {
2453-
mmu_notifier_range_init(&range, MMU_NOTIFY_PROTECTION_VMA, 0,
2454-
mm, p.arg.start, p.arg.end);
2455-
mmu_notifier_invalidate_range_start(&range);
2456-
}
2457-
24582450
for (walk_start = p.arg.start; walk_start < p.arg.end;
24592451
walk_start = p.arg.walk_end) {
2452+
struct mmu_notifier_range range;
24602453
long n_out;
24612454

24622455
if (fatal_signal_pending(current)) {
@@ -2467,8 +2460,20 @@ static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
24672460
ret = mmap_read_lock_killable(mm);
24682461
if (ret)
24692462
break;
2463+
2464+
/* Protection change for the range is going to happen. */
2465+
if (p.arg.flags & PM_SCAN_WP_MATCHING) {
2466+
mmu_notifier_range_init(&range, MMU_NOTIFY_PROTECTION_VMA, 0,
2467+
mm, walk_start, p.arg.end);
2468+
mmu_notifier_invalidate_range_start(&range);
2469+
}
2470+
24702471
ret = walk_page_range(mm, walk_start, p.arg.end,
24712472
&pagemap_scan_ops, &p);
2473+
2474+
if (p.arg.flags & PM_SCAN_WP_MATCHING)
2475+
mmu_notifier_invalidate_range_end(&range);
2476+
24722477
mmap_read_unlock(mm);
24732478

24742479
n_out = pagemap_scan_flush_buffer(&p);
@@ -2494,9 +2499,6 @@ static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
24942499
if (pagemap_scan_writeback_args(&p.arg, uarg))
24952500
ret = -EFAULT;
24962501

2497-
if (p.arg.flags & PM_SCAN_WP_MATCHING)
2498-
mmu_notifier_invalidate_range_end(&range);
2499-
25002502
kfree(p.vec_buf);
25012503
return ret;
25022504
}

kernel/crash_core.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ static int __init reserve_crashkernel_low(unsigned long long low_size)
376376

377377
crashk_low_res.start = low_base;
378378
crashk_low_res.end = low_base + low_size - 1;
379-
insert_resource(&iomem_resource, &crashk_low_res);
380379
#endif
381380
return 0;
382381
}
@@ -458,8 +457,19 @@ void __init reserve_crashkernel_generic(char *cmdline,
458457

459458
crashk_res.start = crash_base;
460459
crashk_res.end = crash_base + crash_size - 1;
461-
insert_resource(&iomem_resource, &crashk_res);
462460
}
461+
462+
static __init int insert_crashkernel_resources(void)
463+
{
464+
if (crashk_res.start < crashk_res.end)
465+
insert_resource(&iomem_resource, &crashk_res);
466+
467+
if (crashk_low_res.start < crashk_low_res.end)
468+
insert_resource(&iomem_resource, &crashk_low_res);
469+
470+
return 0;
471+
}
472+
early_initcall(insert_crashkernel_resources);
463473
#endif
464474

465475
int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
@@ -867,7 +877,7 @@ subsys_initcall(crash_notes_memory_init);
867877
* regions are online. So mutex lock __crash_hotplug_lock is used to
868878
* serialize the crash hotplug handling specifically.
869879
*/
870-
DEFINE_MUTEX(__crash_hotplug_lock);
880+
static DEFINE_MUTEX(__crash_hotplug_lock);
871881
#define crash_hotplug_lock() mutex_lock(&__crash_hotplug_lock)
872882
#define crash_hotplug_unlock() mutex_unlock(&__crash_hotplug_lock)
873883

kernel/kexec_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,7 @@ int kernel_kexec(void)
12571257
kexec_in_progress = true;
12581258
kernel_restart_prepare("kexec reboot");
12591259
migrate_to_reboot_cpu();
1260+
syscore_shutdown();
12601261

12611262
/*
12621263
* migrate_to_reboot_cpu() disables CPU hotplug assuming that

lib/Kconfig.debug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ config DEBUG_INFO_BTF
378378
depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST
379379
depends on BPF_SYSCALL
380380
depends on !DEBUG_INFO_DWARF5 || PAHOLE_VERSION >= 121
381+
# pahole uses elfutils, which does not have support for Hexagon relocations
382+
depends on !HEXAGON
381383
help
382384
Generate deduplicated BTF type information from DWARF debug info.
383385
Turning this on expects presence of pahole tool, which will convert

mm/kasan/generic.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ void kasan_init_object_meta(struct kmem_cache *cache, const void *object)
487487
__memset(alloc_meta, 0, sizeof(*alloc_meta));
488488

489489
/*
490+
* Prepare the lock for saving auxiliary stack traces.
490491
* Temporarily disable KASAN bug reporting to allow instrumented
491492
* raw_spin_lock_init to access aux_lock, which resides inside
492493
* of a redzone.
@@ -510,8 +511,13 @@ static void release_alloc_meta(struct kasan_alloc_meta *meta)
510511
stack_depot_put(meta->aux_stack[0]);
511512
stack_depot_put(meta->aux_stack[1]);
512513

513-
/* Zero out alloc meta to mark it as invalid. */
514-
__memset(meta, 0, sizeof(*meta));
514+
/*
515+
* Zero out alloc meta to mark it as invalid but keep aux_lock
516+
* initialized to avoid having to reinitialize it when another object
517+
* is allocated in the same slot.
518+
*/
519+
__memset(&meta->alloc_track, 0, sizeof(meta->alloc_track));
520+
__memset(meta->aux_stack, 0, sizeof(meta->aux_stack));
515521
}
516522

517523
static void release_free_meta(const void *object, struct kasan_free_meta *meta)

mm/memory_hotplug.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ static int set_memmap_mode(const char *val, const struct kernel_param *kp)
101101

102102
static int get_memmap_mode(char *buffer, const struct kernel_param *kp)
103103
{
104-
if (*((int *)kp->arg) == MEMMAP_ON_MEMORY_FORCE)
105-
return sprintf(buffer, "force\n");
106-
return param_get_bool(buffer, kp);
104+
int mode = *((int *)kp->arg);
105+
106+
if (mode == MEMMAP_ON_MEMORY_FORCE)
107+
return sprintf(buffer, "force\n");
108+
return sprintf(buffer, "%c\n", mode ? 'Y' : 'N');
107109
}
108110

109111
static const struct kernel_param_ops memmap_mode_ops = {

mm/mm_init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/pgtable.h>
2727
#include <linux/swap.h>
2828
#include <linux/cma.h>
29+
#include <linux/crash_dump.h>
2930
#include "internal.h"
3031
#include "slab.h"
3132
#include "shuffle.h"
@@ -381,6 +382,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)
381382
goto out;
382383
}
383384

385+
if (is_kdump_kernel()) {
386+
pr_warn("The system is under kdump, ignore kernelcore=mirror.\n");
387+
goto out;
388+
}
389+
384390
for_each_mem_region(r) {
385391
if (memblock_is_mirror(r))
386392
continue;

mm/userfaultfd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,12 @@ ssize_t move_pages(struct userfaultfd_ctx *ctx, struct mm_struct *mm,
13931393
err = -ENOENT;
13941394
break;
13951395
}
1396+
/* Avoid moving zeropages for now */
1397+
if (is_huge_zero_pmd(*src_pmd)) {
1398+
spin_unlock(ptl);
1399+
err = -EBUSY;
1400+
break;
1401+
}
13961402

13971403
/* Check if we can move the pmd without splitting it. */
13981404
if (move_splits_huge_pmd(dst_addr, src_addr, src_start + len) ||

0 commit comments

Comments
 (0)