Skip to content

Commit 87a132e

Browse files
committed
Merge tag 'mm-hotfixes-stable-2025-02-19-17-49' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "18 hotfixes. 5 are cc:stable and the remainder address post-6.13 issues or aren't considered necessary for -stable kernels. 10 are for MM and 8 are for non-MM. All are singletons, please see the changelogs for details" * tag 'mm-hotfixes-stable-2025-02-19-17-49' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: test_xarray: fix failure in check_pause when CONFIG_XARRAY_MULTI is not defined kasan: don't call find_vm_area() in a PREEMPT_RT kernel MAINTAINERS: update Nick's contact info selftests/mm: fix check for running THP tests mm: hugetlb: avoid fallback for specific node allocation of 1G pages memcg: avoid dead loop when setting memory.max mailmap: update Nick's entry mm: pgtable: fix incorrect reclaim of non-empty PTE pages taskstats: modify taskstats version getdelays: fix error format characters mm/migrate_device: don't add folio to be freed to LRU in migrate_device_finalize() tools/mm: fix build warnings with musl-libc mailmap: add entry for Feng Tang .mailmap: add entries for Jeff Johnson mm,madvise,hugetlb: check for 0-length range after end address adjustment mm/zswap: fix inconsistency when zswap_store_page() fails lib/iov_iter: fix import_iovec_ubuf iovec management procfs: fix a locking bug in a vmcore_add_device_dump() error path
2 parents 6537cfb + 8344017 commit 87a132e

File tree

18 files changed

+120
-66
lines changed

18 files changed

+120
-66
lines changed

.mailmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ Fangrui Song <i@maskray.me> <maskray@google.com>
226226
Felipe W Damasio <felipewd@terra.com.br>
227227
Felix Kuhling <fxkuehl@gmx.de>
228228
Felix Moeller <felix@derklecks.de>
229+
Feng Tang <feng.79.tang@gmail.com> <feng.tang@intel.com>
229230
Fenglin Wu <quic_fenglinw@quicinc.com> <fenglinw@codeaurora.org>
230231
Filipe Lautert <filipe@icewall.org>
231232
Finn Thain <fthain@linux-m68k.org> <fthain@telegraphics.com.au>
@@ -317,6 +318,8 @@ Jayachandran C <c.jayachandran@gmail.com> <jnair@caviumnetworks.com>
317318
Jean Tourrilhes <jt@hpl.hp.com>
318319
Jeevan Shriram <quic_jshriram@quicinc.com> <jshriram@codeaurora.org>
319320
Jeff Garzik <jgarzik@pretzel.yyz.us>
321+
Jeff Johnson <jeff.johnson@oss.qualcomm.com> <jjohnson@codeaurora.org>
322+
Jeff Johnson <jeff.johnson@oss.qualcomm.com> <quic_jjohnson@quicinc.com>
320323
Jeff Layton <jlayton@kernel.org> <jlayton@poochiereds.net>
321324
Jeff Layton <jlayton@kernel.org> <jlayton@primarydata.com>
322325
Jeff Layton <jlayton@kernel.org> <jlayton@redhat.com>
@@ -531,6 +534,7 @@ Nicholas Piggin <npiggin@gmail.com> <npiggin@kernel.dk>
531534
Nicholas Piggin <npiggin@gmail.com> <npiggin@suse.de>
532535
Nicholas Piggin <npiggin@gmail.com> <nickpiggin@yahoo.com.au>
533536
Nicholas Piggin <npiggin@gmail.com> <piggin@cyberone.com.au>
537+
Nick Desaulniers <nick.desaulniers+lkml@gmail.com> <ndesaulniers@google.com>
534538
Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>
535539
Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>
536540
Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org>

Documentation/process/embargoed-hardware-issues.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ an involved disclosed party. The current ambassadors list:
308308

309309
Google Kees Cook <keescook@chromium.org>
310310

311-
LLVM Nick Desaulniers <ndesaulniers@google.com>
311+
LLVM Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
312312
============= ========================================================
313313

314314
If you want your organization to be added to the ambassadors list, please

Documentation/translations/sp_SP/process/embargoed-hardware-issues.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ revelada involucrada. La lista de embajadores actuales:
287287

288288
Google Kees Cook <keescook@chromium.org>
289289

290-
LLVM Nick Desaulniers <ndesaulniers@google.com>
290+
LLVM Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
291291
============= ========================================================
292292

293293
Si quiere que su organización se añada a la lista de embajadores, por

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5655,7 +5655,7 @@ F: .clang-format
56555655

56565656
CLANG/LLVM BUILD SUPPORT
56575657
M: Nathan Chancellor <nathan@kernel.org>
5658-
R: Nick Desaulniers <ndesaulniers@google.com>
5658+
R: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
56595659
R: Bill Wendling <morbo@google.com>
56605660
R: Justin Stitt <justinstitt@google.com>
56615661
L: llvm@lists.linux.dev

fs/proc/vmcore.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,14 +1524,17 @@ int vmcore_add_device_dump(struct vmcoredd_data *data)
15241524
pr_warn_once("Unexpected adding of device dump\n");
15251525
if (vmcore_open) {
15261526
ret = -EBUSY;
1527-
goto out_err;
1527+
goto unlock;
15281528
}
15291529

15301530
list_add_tail(&dump->list, &vmcoredd_list);
15311531
vmcoredd_update_size(data_size);
15321532
mutex_unlock(&vmcore_mutex);
15331533
return 0;
15341534

1535+
unlock:
1536+
mutex_unlock(&vmcore_mutex);
1537+
15351538
out_err:
15361539
vfree(buf);
15371540
vfree(dump);

include/uapi/linux/taskstats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535

3636

37-
#define TASKSTATS_VERSION 14
37+
#define TASKSTATS_VERSION 15
3838
#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939
* in linux/sched.h */
4040

lib/iov_iter.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,8 @@ static ssize_t __import_iovec_ubuf(int type, const struct iovec __user *uvec,
14281428
struct iovec *iov = *iovp;
14291429
ssize_t ret;
14301430

1431+
*iovp = NULL;
1432+
14311433
if (compat)
14321434
ret = copy_compat_iovec_from_user(iov, uvec, 1);
14331435
else
@@ -1438,7 +1440,6 @@ static ssize_t __import_iovec_ubuf(int type, const struct iovec __user *uvec,
14381440
ret = import_ubuf(type, iov->iov_base, iov->iov_len, i);
14391441
if (unlikely(ret))
14401442
return ret;
1441-
*iovp = NULL;
14421443
return i->count;
14431444
}
14441445

lib/test_xarray.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ static noinline void check_pause(struct xarray *xa)
14181418
{
14191419
XA_STATE(xas, xa, 0);
14201420
void *entry;
1421-
unsigned int order;
1421+
int order;
14221422
unsigned long index = 1;
14231423
unsigned int count = 0;
14241424

@@ -1450,7 +1450,7 @@ static noinline void check_pause(struct xarray *xa)
14501450
xa_destroy(xa);
14511451

14521452
index = 0;
1453-
for (order = XA_CHUNK_SHIFT; order > 0; order--) {
1453+
for (order = order_limit - 1; order >= 0; order--) {
14541454
XA_BUG_ON(xa, xa_store_order(xa, index, order,
14551455
xa_mk_index(index), GFP_KERNEL));
14561456
index += 1UL << order;
@@ -1462,24 +1462,25 @@ static noinline void check_pause(struct xarray *xa)
14621462
rcu_read_lock();
14631463
xas_for_each(&xas, entry, ULONG_MAX) {
14641464
XA_BUG_ON(xa, entry != xa_mk_index(index));
1465-
index += 1UL << (XA_CHUNK_SHIFT - count);
1465+
index += 1UL << (order_limit - count - 1);
14661466
count++;
14671467
}
14681468
rcu_read_unlock();
1469-
XA_BUG_ON(xa, count != XA_CHUNK_SHIFT);
1469+
XA_BUG_ON(xa, count != order_limit);
14701470

14711471
index = 0;
14721472
count = 0;
1473-
xas_set(&xas, XA_CHUNK_SIZE / 2 + 1);
1473+
/* test unaligned index */
1474+
xas_set(&xas, 1 % (1UL << (order_limit - 1)));
14741475
rcu_read_lock();
14751476
xas_for_each(&xas, entry, ULONG_MAX) {
14761477
XA_BUG_ON(xa, entry != xa_mk_index(index));
1477-
index += 1UL << (XA_CHUNK_SHIFT - count);
1478+
index += 1UL << (order_limit - count - 1);
14781479
count++;
14791480
xas_pause(&xas);
14801481
}
14811482
rcu_read_unlock();
1482-
XA_BUG_ON(xa, count != XA_CHUNK_SHIFT);
1483+
XA_BUG_ON(xa, count != order_limit);
14831484

14841485
xa_destroy(xa);
14851486

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,7 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid)
31453145

31463146
/* do node specific alloc */
31473147
if (nid != NUMA_NO_NODE) {
3148-
m = memblock_alloc_try_nid_raw(huge_page_size(h), huge_page_size(h),
3148+
m = memblock_alloc_exact_nid_raw(huge_page_size(h), huge_page_size(h),
31493149
0, MEMBLOCK_ALLOC_ACCESSIBLE, nid);
31503150
if (!m)
31513151
return 0;

mm/kasan/report.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,36 @@ static inline bool init_task_stack_addr(const void *addr)
370370
sizeof(init_thread_union.stack));
371371
}
372372

373+
/*
374+
* This function is invoked with report_lock (a raw_spinlock) held. A
375+
* PREEMPT_RT kernel cannot call find_vm_area() as it will acquire a sleeping
376+
* rt_spinlock.
377+
*
378+
* For !RT kernel, the PROVE_RAW_LOCK_NESTING config option will print a
379+
* lockdep warning for this raw_spinlock -> spinlock dependency. This config
380+
* option is enabled by default to ensure better test coverage to expose this
381+
* kind of RT kernel problem. This lockdep splat, however, can be suppressed
382+
* by using DEFINE_WAIT_OVERRIDE_MAP() if it serves a useful purpose and the
383+
* invalid PREEMPT_RT case has been taken care of.
384+
*/
385+
static inline struct vm_struct *kasan_find_vm_area(void *addr)
386+
{
387+
static DEFINE_WAIT_OVERRIDE_MAP(vmalloc_map, LD_WAIT_SLEEP);
388+
struct vm_struct *va;
389+
390+
if (IS_ENABLED(CONFIG_PREEMPT_RT))
391+
return NULL;
392+
393+
/*
394+
* Suppress lockdep warning and fetch vmalloc area of the
395+
* offending address.
396+
*/
397+
lock_map_acquire_try(&vmalloc_map);
398+
va = find_vm_area(addr);
399+
lock_map_release(&vmalloc_map);
400+
return va;
401+
}
402+
373403
static void print_address_description(void *addr, u8 tag,
374404
struct kasan_report_info *info)
375405
{
@@ -399,7 +429,7 @@ static void print_address_description(void *addr, u8 tag,
399429
}
400430

401431
if (is_vmalloc_addr(addr)) {
402-
struct vm_struct *va = find_vm_area(addr);
432+
struct vm_struct *va = kasan_find_vm_area(addr);
403433

404434
if (va) {
405435
pr_err("The buggy address belongs to the virtual mapping at\n"
@@ -409,6 +439,8 @@ static void print_address_description(void *addr, u8 tag,
409439
pr_err("\n");
410440

411441
page = vmalloc_to_page(addr);
442+
} else {
443+
pr_err("The buggy address %px belongs to a vmalloc virtual mapping\n", addr);
412444
}
413445
}
414446

0 commit comments

Comments
 (0)