Skip to content

Commit 69062f2

Browse files
committed
Merge tag 'mm-hotfixes-stable-2026-02-26-14-14' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "12 hotfixes. 7 are cc:stable. 8 are for MM. All are singletons - please see the changelogs for details" * tag 'mm-hotfixes-stable-2026-02-26-14-14' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: MAINTAINERS: update Yosry Ahmed's email address mailmap: add entry for Daniele Alessandrelli mm: fix NULL NODE_DATA dereference for memoryless nodes on boot mm/tracing: rss_stat: ensure curr is false from kthread context mm/kfence: fix KASAN hardware tag faults during late enablement mm/damon/core: disallow non-power of two min_region_sz Squashfs: check metadata block offset is within range MAINTAINERS, mailmap: update e-mail address for Vlastimil Babka liveupdate: luo_file: remember retrieve() status mm: thp: deny THP for files on anonymous inodes mm: change vma_alloc_folio_noprof() macro to inline function mm/kfence: disable KFENCE upon KASAN HW tags enablement
2 parents 944e15f + 410aed6 commit 69062f2

13 files changed

Lines changed: 102 additions & 42 deletions

File tree

.mailmap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ Daniel Lezcano <daniel.lezcano@kernel.org> <daniel.lezcano@free.fr>
215215
Daniel Lezcano <daniel.lezcano@kernel.org> <daniel.lezcano@linexp.org>
216216
Daniel Lezcano <daniel.lezcano@kernel.org> <dlezcano@fr.ibm.com>
217217
Daniel Thompson <danielt@kernel.org> <daniel.thompson@linaro.org>
218+
Daniele Alessandrelli <daniele.alessandrelli@gmail.com> <daniele.alessandrelli@intel.com>
218219
Danilo Krummrich <dakr@kernel.org> <dakr@redhat.com>
219220
David Brownell <david-b@pacbell.net>
220221
David Collins <quic_collinsd@quicinc.com> <collinsd@codeaurora.org>
@@ -880,6 +881,7 @@ Vivien Didelot <vivien.didelot@gmail.com> <vivien.didelot@savoirfairelinux.com>
880881
Vlad Dogaru <ddvlad@gmail.com> <vlad.dogaru@intel.com>
881882
Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com>
882883
Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@virtuozzo.com>
884+
Vlastimil Babka <vbabka@kernel.org> <vbabka@suse.cz>
883885
WangYuli <wangyuli@aosc.io> <wangyl5933@chinaunicom.cn>
884886
WangYuli <wangyuli@aosc.io> <wangyuli@deepin.org>
885887
Weiwen Hu <huweiwen@linux.alibaba.com> <sehuww@mail.scut.edu.cn>
@@ -894,7 +896,8 @@ Yanteng Si <si.yanteng@linux.dev> <siyanteng@loongson.cn>
894896
Ying Huang <huang.ying.caritas@gmail.com> <ying.huang@intel.com>
895897
Yixun Lan <dlan@kernel.org> <dlan@gentoo.org>
896898
Yixun Lan <dlan@kernel.org> <yixun.lan@amlogic.com>
897-
Yosry Ahmed <yosry.ahmed@linux.dev> <yosryahmed@google.com>
899+
Yosry Ahmed <yosry@kernel.org> <yosryahmed@google.com>
900+
Yosry Ahmed <yosry@kernel.org> <yosry.ahmed@linux.dev>
898901
Yu-Chun Lin <eleanor.lin@realtek.com> <eleanor15x@gmail.com>
899902
Yusuke Goda <goda.yusuke@renesas.com>
900903
Zack Rusin <zack.rusin@broadcom.com> <zackr@vmware.com>

MAINTAINERS

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16654,7 +16654,7 @@ M: Andrew Morton <akpm@linux-foundation.org>
1665416654
M: David Hildenbrand <david@kernel.org>
1665516655
R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1665616656
R: Liam R. Howlett <Liam.Howlett@oracle.com>
16657-
R: Vlastimil Babka <vbabka@suse.cz>
16657+
R: Vlastimil Babka <vbabka@kernel.org>
1665816658
R: Mike Rapoport <rppt@kernel.org>
1665916659
R: Suren Baghdasaryan <surenb@google.com>
1666016660
R: Michal Hocko <mhocko@suse.com>
@@ -16784,7 +16784,7 @@ M: Andrew Morton <akpm@linux-foundation.org>
1678416784
M: David Hildenbrand <david@kernel.org>
1678516785
R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1678616786
R: Liam R. Howlett <Liam.Howlett@oracle.com>
16787-
R: Vlastimil Babka <vbabka@suse.cz>
16787+
R: Vlastimil Babka <vbabka@kernel.org>
1678816788
R: Mike Rapoport <rppt@kernel.org>
1678916789
R: Suren Baghdasaryan <surenb@google.com>
1679016790
R: Michal Hocko <mhocko@suse.com>
@@ -16839,7 +16839,7 @@ F: mm/oom_kill.c
1683916839

1684016840
MEMORY MANAGEMENT - PAGE ALLOCATOR
1684116841
M: Andrew Morton <akpm@linux-foundation.org>
16842-
M: Vlastimil Babka <vbabka@suse.cz>
16842+
M: Vlastimil Babka <vbabka@kernel.org>
1684316843
R: Suren Baghdasaryan <surenb@google.com>
1684416844
R: Michal Hocko <mhocko@suse.com>
1684516845
R: Brendan Jackman <jackmanb@google.com>
@@ -16885,7 +16885,7 @@ M: David Hildenbrand <david@kernel.org>
1688516885
M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1688616886
R: Rik van Riel <riel@surriel.com>
1688716887
R: Liam R. Howlett <Liam.Howlett@oracle.com>
16888-
R: Vlastimil Babka <vbabka@suse.cz>
16888+
R: Vlastimil Babka <vbabka@kernel.org>
1688916889
R: Harry Yoo <harry.yoo@oracle.com>
1689016890
R: Jann Horn <jannh@google.com>
1689116891
L: linux-mm@kvack.org
@@ -16984,7 +16984,7 @@ MEMORY MAPPING
1698416984
M: Andrew Morton <akpm@linux-foundation.org>
1698516985
M: Liam R. Howlett <Liam.Howlett@oracle.com>
1698616986
M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
16987-
R: Vlastimil Babka <vbabka@suse.cz>
16987+
R: Vlastimil Babka <vbabka@kernel.org>
1698816988
R: Jann Horn <jannh@google.com>
1698916989
R: Pedro Falcato <pfalcato@suse.de>
1699016990
L: linux-mm@kvack.org
@@ -17014,7 +17014,7 @@ M: Andrew Morton <akpm@linux-foundation.org>
1701417014
M: Suren Baghdasaryan <surenb@google.com>
1701517015
M: Liam R. Howlett <Liam.Howlett@oracle.com>
1701617016
M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
17017-
R: Vlastimil Babka <vbabka@suse.cz>
17017+
R: Vlastimil Babka <vbabka@kernel.org>
1701817018
R: Shakeel Butt <shakeel.butt@linux.dev>
1701917019
L: linux-mm@kvack.org
1702017020
S: Maintained
@@ -17030,7 +17030,7 @@ M: Andrew Morton <akpm@linux-foundation.org>
1703017030
M: Liam R. Howlett <Liam.Howlett@oracle.com>
1703117031
M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
1703217032
M: David Hildenbrand <david@kernel.org>
17033-
R: Vlastimil Babka <vbabka@suse.cz>
17033+
R: Vlastimil Babka <vbabka@kernel.org>
1703417034
R: Jann Horn <jannh@google.com>
1703517035
L: linux-mm@kvack.org
1703617036
S: Maintained
@@ -23172,7 +23172,7 @@ K: \b(?i:rust)\b
2317223172
RUST [ALLOC]
2317323173
M: Danilo Krummrich <dakr@kernel.org>
2317423174
R: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
23175-
R: Vlastimil Babka <vbabka@suse.cz>
23175+
R: Vlastimil Babka <vbabka@kernel.org>
2317623176
R: Liam R. Howlett <Liam.Howlett@oracle.com>
2317723177
R: Uladzislau Rezki <urezki@gmail.com>
2317823178
L: rust-for-linux@vger.kernel.org
@@ -24348,7 +24348,7 @@ F: Documentation/devicetree/bindings/nvmem/layouts/kontron,sl28-vpd.yaml
2434824348
F: drivers/nvmem/layouts/sl28vpd.c
2434924349

2435024350
SLAB ALLOCATOR
24351-
M: Vlastimil Babka <vbabka@suse.cz>
24351+
M: Vlastimil Babka <vbabka@kernel.org>
2435224352
M: Andrew Morton <akpm@linux-foundation.org>
2435324353
R: Christoph Lameter <cl@gentwo.org>
2435424354
R: David Rientjes <rientjes@google.com>
@@ -29184,7 +29184,7 @@ K: zstd
2918429184

2918529185
ZSWAP COMPRESSED SWAP CACHING
2918629186
M: Johannes Weiner <hannes@cmpxchg.org>
29187-
M: Yosry Ahmed <yosry.ahmed@linux.dev>
29187+
M: Yosry Ahmed <yosry@kernel.org>
2918829188
M: Nhat Pham <nphamcs@gmail.com>
2918929189
R: Chengming Zhou <chengming.zhou@linux.dev>
2919029190
L: linux-mm@kvack.org

fs/squashfs/cache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ int squashfs_read_metadata(struct super_block *sb, void *buffer,
344344
if (unlikely(length < 0))
345345
return -EIO;
346346

347+
if (unlikely(*offset < 0 || *offset >= SQUASHFS_METADATA_SIZE))
348+
return -EIO;
349+
347350
while (length) {
348351
entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0);
349352
if (entry->error) {

include/linux/gfp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,11 @@ static inline struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int orde
339339
{
340340
return folio_alloc_noprof(gfp, order);
341341
}
342-
#define vma_alloc_folio_noprof(gfp, order, vma, addr) \
343-
folio_alloc_noprof(gfp, order)
342+
static inline struct folio *vma_alloc_folio_noprof(gfp_t gfp, int order,
343+
struct vm_area_struct *vma, unsigned long addr)
344+
{
345+
return folio_alloc_noprof(gfp, order);
346+
}
344347
#endif
345348

346349
#define alloc_pages(...) alloc_hooks(alloc_pages_noprof(__VA_ARGS__))

include/linux/liveupdate.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ struct file;
2323
/**
2424
* struct liveupdate_file_op_args - Arguments for file operation callbacks.
2525
* @handler: The file handler being called.
26-
* @retrieved: The retrieve status for the 'can_finish / finish'
27-
* operation.
26+
* @retrieve_status: The retrieve status for the 'can_finish / finish'
27+
* operation. A value of 0 means the retrieve has not been
28+
* attempted, a positive value means the retrieve was
29+
* successful, and a negative value means the retrieve failed,
30+
* and the value is the error code of the call.
2831
* @file: The file object. For retrieve: [OUT] The callback sets
2932
* this to the new file. For other ops: [IN] The caller sets
3033
* this to the file being operated on.
@@ -40,7 +43,7 @@ struct file;
4043
*/
4144
struct liveupdate_file_op_args {
4245
struct liveupdate_file_handler *handler;
43-
bool retrieved;
46+
int retrieve_status;
4447
struct file *file;
4548
u64 serialized_data;
4649
void *private_data;

include/trace/events/kmem.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,13 @@ TRACE_EVENT(rss_stat,
440440

441441
TP_fast_assign(
442442
__entry->mm_id = mm_ptr_to_hash(mm);
443-
__entry->curr = !!(current->mm == mm);
443+
/*
444+
* curr is true if the mm matches the current task's mm_struct.
445+
* Since kthreads (PF_KTHREAD) have no mm_struct of their own
446+
* but can borrow one via kthread_use_mm(), we must filter them
447+
* out to avoid incorrectly attributing the RSS update to them.
448+
*/
449+
__entry->curr = current->mm == mm && !(current->flags & PF_KTHREAD);
444450
__entry->member = member;
445451
__entry->size = (percpu_counter_sum_positive(&mm->rss_stat[member])
446452
<< PAGE_SHIFT);

kernel/liveupdate/luo_file.c

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ static LIST_HEAD(luo_file_handler_list);
134134
* state that is not preserved. Set by the handler's .preserve()
135135
* callback, and must be freed in the handler's .unpreserve()
136136
* callback.
137-
* @retrieved: A flag indicating whether a user/kernel in the new kernel has
137+
* @retrieve_status: Status code indicating whether a user/kernel in the new kernel has
138138
* successfully called retrieve() on this file. This prevents
139-
* multiple retrieval attempts.
139+
* multiple retrieval attempts. A value of 0 means a retrieve()
140+
* has not been attempted, a positive value means the retrieve()
141+
* was successful, and a negative value means the retrieve()
142+
* failed, and the value is the error code of the call.
140143
* @mutex: A mutex that protects the fields of this specific instance
141144
* (e.g., @retrieved, @file), ensuring that operations like
142145
* retrieving or finishing a file are atomic.
@@ -161,7 +164,7 @@ struct luo_file {
161164
struct file *file;
162165
u64 serialized_data;
163166
void *private_data;
164-
bool retrieved;
167+
int retrieve_status;
165168
struct mutex mutex;
166169
struct list_head list;
167170
u64 token;
@@ -298,7 +301,6 @@ int luo_preserve_file(struct luo_file_set *file_set, u64 token, int fd)
298301
luo_file->file = file;
299302
luo_file->fh = fh;
300303
luo_file->token = token;
301-
luo_file->retrieved = false;
302304
mutex_init(&luo_file->mutex);
303305

304306
args.handler = fh;
@@ -577,7 +579,12 @@ int luo_retrieve_file(struct luo_file_set *file_set, u64 token,
577579
return -ENOENT;
578580

579581
guard(mutex)(&luo_file->mutex);
580-
if (luo_file->retrieved) {
582+
if (luo_file->retrieve_status < 0) {
583+
/* Retrieve was attempted and it failed. Return the error code. */
584+
return luo_file->retrieve_status;
585+
}
586+
587+
if (luo_file->retrieve_status > 0) {
581588
/*
582589
* Someone is asking for this file again, so get a reference
583590
* for them.
@@ -590,16 +597,19 @@ int luo_retrieve_file(struct luo_file_set *file_set, u64 token,
590597
args.handler = luo_file->fh;
591598
args.serialized_data = luo_file->serialized_data;
592599
err = luo_file->fh->ops->retrieve(&args);
593-
if (!err) {
594-
luo_file->file = args.file;
595-
596-
/* Get reference so we can keep this file in LUO until finish */
597-
get_file(luo_file->file);
598-
*filep = luo_file->file;
599-
luo_file->retrieved = true;
600+
if (err) {
601+
/* Keep the error code for later use. */
602+
luo_file->retrieve_status = err;
603+
return err;
600604
}
601605

602-
return err;
606+
luo_file->file = args.file;
607+
/* Get reference so we can keep this file in LUO until finish */
608+
get_file(luo_file->file);
609+
*filep = luo_file->file;
610+
luo_file->retrieve_status = 1;
611+
612+
return 0;
603613
}
604614

605615
static int luo_file_can_finish_one(struct luo_file_set *file_set,
@@ -615,7 +625,7 @@ static int luo_file_can_finish_one(struct luo_file_set *file_set,
615625
args.handler = luo_file->fh;
616626
args.file = luo_file->file;
617627
args.serialized_data = luo_file->serialized_data;
618-
args.retrieved = luo_file->retrieved;
628+
args.retrieve_status = luo_file->retrieve_status;
619629
can_finish = luo_file->fh->ops->can_finish(&args);
620630
}
621631

@@ -632,7 +642,7 @@ static void luo_file_finish_one(struct luo_file_set *file_set,
632642
args.handler = luo_file->fh;
633643
args.file = luo_file->file;
634644
args.serialized_data = luo_file->serialized_data;
635-
args.retrieved = luo_file->retrieved;
645+
args.retrieve_status = luo_file->retrieve_status;
636646

637647
luo_file->fh->ops->finish(&args);
638648
luo_flb_file_finish(luo_file->fh);
@@ -788,7 +798,6 @@ int luo_file_deserialize(struct luo_file_set *file_set,
788798
luo_file->file = NULL;
789799
luo_file->serialized_data = file_ser[i].data;
790800
luo_file->token = file_ser[i].token;
791-
luo_file->retrieved = false;
792801
mutex_init(&luo_file->mutex);
793802
list_add_tail(&luo_file->list, &file_set->files_list);
794803
}

mm/damon/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ int damon_commit_ctx(struct damon_ctx *dst, struct damon_ctx *src)
12521252
{
12531253
int err;
12541254

1255+
if (!is_power_of_2(src->min_region_sz))
1256+
return -EINVAL;
1257+
12551258
err = damon_commit_schemes(dst, src);
12561259
if (err)
12571260
return err;

mm/huge_memory.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma)
9494

9595
inode = file_inode(vma->vm_file);
9696

97+
if (IS_ANON_FILE(inode))
98+
return false;
99+
97100
return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode);
98101
}
99102

mm/kfence/core.c

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/hash.h>
1414
#include <linux/irq_work.h>
1515
#include <linux/jhash.h>
16+
#include <linux/kasan-enabled.h>
1617
#include <linux/kcsan-checks.h>
1718
#include <linux/kfence.h>
1819
#include <linux/kmemleak.h>
@@ -916,6 +917,20 @@ void __init kfence_alloc_pool_and_metadata(void)
916917
if (!kfence_sample_interval)
917918
return;
918919

920+
/*
921+
* If KASAN hardware tags are enabled, disable KFENCE, because it
922+
* does not support MTE yet.
923+
*/
924+
if (kasan_hw_tags_enabled()) {
925+
pr_info("disabled as KASAN HW tags are enabled\n");
926+
if (__kfence_pool) {
927+
memblock_free(__kfence_pool, KFENCE_POOL_SIZE);
928+
__kfence_pool = NULL;
929+
}
930+
kfence_sample_interval = 0;
931+
return;
932+
}
933+
919934
/*
920935
* If the pool has already been initialized by arch, there is no need to
921936
* re-allocate the memory pool.
@@ -989,14 +1004,14 @@ static int kfence_init_late(void)
9891004
#ifdef CONFIG_CONTIG_ALLOC
9901005
struct page *pages;
9911006

992-
pages = alloc_contig_pages(nr_pages_pool, GFP_KERNEL, first_online_node,
993-
NULL);
1007+
pages = alloc_contig_pages(nr_pages_pool, GFP_KERNEL | __GFP_SKIP_KASAN,
1008+
first_online_node, NULL);
9941009
if (!pages)
9951010
return -ENOMEM;
9961011

9971012
__kfence_pool = page_to_virt(pages);
998-
pages = alloc_contig_pages(nr_pages_meta, GFP_KERNEL, first_online_node,
999-
NULL);
1013+
pages = alloc_contig_pages(nr_pages_meta, GFP_KERNEL | __GFP_SKIP_KASAN,
1014+
first_online_node, NULL);
10001015
if (pages)
10011016
kfence_metadata_init = page_to_virt(pages);
10021017
#else
@@ -1006,11 +1021,13 @@ static int kfence_init_late(void)
10061021
return -EINVAL;
10071022
}
10081023

1009-
__kfence_pool = alloc_pages_exact(KFENCE_POOL_SIZE, GFP_KERNEL);
1024+
__kfence_pool = alloc_pages_exact(KFENCE_POOL_SIZE,
1025+
GFP_KERNEL | __GFP_SKIP_KASAN);
10101026
if (!__kfence_pool)
10111027
return -ENOMEM;
10121028

1013-
kfence_metadata_init = alloc_pages_exact(KFENCE_METADATA_SIZE, GFP_KERNEL);
1029+
kfence_metadata_init = alloc_pages_exact(KFENCE_METADATA_SIZE,
1030+
GFP_KERNEL | __GFP_SKIP_KASAN);
10141031
#endif
10151032

10161033
if (!kfence_metadata_init)

0 commit comments

Comments
 (0)