Skip to content

Commit 6f3d7d5

Browse files
committed
Merge tag 'mm-hotfixes-stable-2024-01-28-23-21' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "22 hotfixes. 11 are cc:stable and the remainder address post-6.7 issues or aren't considered appropriate for backporting" * tag 'mm-hotfixes-stable-2024-01-28-23-21' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (22 commits) mm: thp_get_unmapped_area must honour topdown preference mm: huge_memory: don't force huge page alignment on 32 bit userfaultfd: fix mmap_changing checking in mfill_atomic_hugetlb selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory scs: add CONFIG_MMU dependency for vfree_atomic() mm/memory: fix folio_set_dirty() vs. folio_mark_dirty() in zap_pte_range() mm/huge_memory: fix folio_set_dirty() vs. folio_mark_dirty() selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag selftests: mm: fix map_hugetlb failure on 64K page size systems MAINTAINERS: supplement of zswap maintainers update stackdepot: make fast paths lock-less again stackdepot: add stats counters exported via debugfs mm, kmsan: fix infinite recursion due to RCU critical section mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again selftests/mm: switch to bash from sh MAINTAINERS: add man-pages git trees mm: memcontrol: don't throttle dying tasks on memory.high mm: mmap: map MAP_STACK to VM_NOHUGEPAGE uprobes: use pagesize-aligned virtual address when replacing pages selftests/mm: mremap_test: fix build warning ...
2 parents 41bccc9 + 96204e1 commit 6f3d7d5

23 files changed

+394
-156
lines changed

CREDITS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,19 @@ N: Mike Kravetz
21612161
21622162
D: Maintenance and development of the hugetlb subsystem
21632163

2164+
N: Seth Jennings
2165+
2166+
D: Creation and maintenance of zswap
2167+
2168+
N: Dan Streetman
2169+
2170+
D: Maintenance and development of zswap
2171+
D: Creation and maintenance of the zpool API
2172+
2173+
N: Vitaly Wool
2174+
2175+
D: Maintenance and development of zswap
2176+
21642177
N: Andreas S. Krebs
21652178
21662179
D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards

MAINTAINERS

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12903,6 +12903,8 @@ M: Alejandro Colomar <[email protected]>
1290312903
1290412904
S: Maintained
1290512905
W: http://www.kernel.org/doc/man-pages
12906+
T: git git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
12907+
T: git git://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git
1290612908

1290712909
MANAGEMENT COMPONENT TRANSPORT PROTOCOL (MCTP)
1290812910
M: Jeremy Kerr <[email protected]>
@@ -24341,13 +24343,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs.git
2434124343
F: Documentation/filesystems/zonefs.rst
2434224344
F: fs/zonefs/
2434324345

24344-
ZPOOL COMPRESSED PAGE STORAGE API
24345-
M: Dan Streetman <[email protected]>
24346-
24347-
S: Maintained
24348-
F: include/linux/zpool.h
24349-
F: mm/zpool.c
24350-
2435124346
ZR36067 VIDEO FOR LINUX DRIVER
2435224347
M: Corentin Labbe <[email protected]>
2435324348
@@ -24399,7 +24394,9 @@ M: Nhat Pham <[email protected]>
2439924394
2440024395
S: Maintained
2440124396
F: Documentation/admin-guide/mm/zswap.rst
24397+
F: include/linux/zpool.h
2440224398
F: include/linux/zswap.h
24399+
F: mm/zpool.c
2440324400
F: mm/zswap.c
2440424401

2440524402
THE REST

arch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ config SHADOW_CALL_STACK
673673
bool "Shadow Call Stack"
674674
depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
675675
depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
676+
depends on MMU
676677
help
677678
This option enables the compiler's Shadow Call Stack, which
678679
uses a shadow stack to protect function return addresses from

arch/x86/include/asm/kmsan.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static inline bool kmsan_virt_addr_valid(void *addr)
6464
{
6565
unsigned long x = (unsigned long)addr;
6666
unsigned long y = x - __START_KERNEL_map;
67+
bool ret;
6768

6869
/* use the carry flag to determine if x was < __START_KERNEL_map */
6970
if (unlikely(x > y)) {
@@ -79,7 +80,21 @@ static inline bool kmsan_virt_addr_valid(void *addr)
7980
return false;
8081
}
8182

82-
return pfn_valid(x >> PAGE_SHIFT);
83+
/*
84+
* pfn_valid() relies on RCU, and may call into the scheduler on exiting
85+
* the critical section. However, this would result in recursion with
86+
* KMSAN. Therefore, disable preemption here, and re-enable preemption
87+
* below while suppressing reschedules to avoid recursion.
88+
*
89+
* Note, this sacrifices occasionally breaking scheduling guarantees.
90+
* Although, a kernel compiled with KMSAN has already given up on any
91+
* performance guarantees due to being heavily instrumented.
92+
*/
93+
preempt_disable();
94+
ret = pfn_valid(x >> PAGE_SHIFT);
95+
preempt_enable_no_resched();
96+
97+
return ret;
8398
}
8499

85100
#endif /* !MODULE */

fs/hugetlbfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to)
340340
} else {
341341
folio_unlock(folio);
342342

343-
if (!folio_test_has_hwpoisoned(folio))
343+
if (!folio_test_hwpoison(folio))
344344
want = nr;
345345
else {
346346
/*

include/linux/mman.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ calc_vm_flag_bits(unsigned long flags)
156156
return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |
157157
_calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) |
158158
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) |
159+
_calc_vm_trans(flags, MAP_STACK, VM_NOHUGEPAGE) |
159160
arch_calc_vm_flag_bits(flags);
160161
}
161162

include/linux/mmzone.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,17 +2013,17 @@ static inline int pfn_valid(unsigned long pfn)
20132013
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
20142014
return 0;
20152015
ms = __pfn_to_section(pfn);
2016-
rcu_read_lock();
2016+
rcu_read_lock_sched();
20172017
if (!valid_section(ms)) {
2018-
rcu_read_unlock();
2018+
rcu_read_unlock_sched();
20192019
return 0;
20202020
}
20212021
/*
20222022
* Traditionally early sections always returned pfn_valid() for
20232023
* the entire section-sized span.
20242024
*/
20252025
ret = early_section(ms) || pfn_section_valid(ms, pfn);
2026-
rcu_read_unlock();
2026+
rcu_read_unlock_sched();
20272027

20282028
return ret;
20292029
}

kernel/events/uprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
537537
}
538538
}
539539

540-
ret = __replace_page(vma, vaddr, old_page, new_page);
540+
ret = __replace_page(vma, vaddr & PAGE_MASK, old_page, new_page);
541541
if (new_page)
542542
put_page(new_page);
543543
put_old:

0 commit comments

Comments
 (0)