[PATCH 0/4] mm: AI-generated fixes for coda, madvise, mprotect and PAGEMAP_SCAN

From: Lorenzo Stoakes (ARM)

Date: Fri Nov 27 2026 - 14:46:03 EST


The usual stuff - glorious gifts of AI goodness transmuted into a smoother
form by your's truly.

Please check for any insanity. OK wait, let me clarify - in the patches.

The only one that needs a backport is the first coda fixup, whereupon, in
the unlikely scenario of a container manager doing something rather silly,
we might end up with a dangling pointer.

Whilst unlikely, that one might be worth sending out sooner rather than
later.

The rest are the usual edge case stuff, one involving the truly cursed
'guess what it's possible to map at address 0 if you're crazy enough!' type
thing.

I shan't talk about the evils contained in the last patch. PAGEMAP_SCAN
deep inside your soul ye masses to find salvation from PM_SCAN_WP_MATCHING!

Anyway, as usual, please review! Thanks.

(Also note that a lack of Cc: stable is not a mistake, rather it means that
I think the fix doesn't warrant any back port shenanigans.)

Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
---
Chris Mason (2):
mm/madvise: don't declare OOM for MADV_WILLNEED swapin
mm/mprotect: fix unpaired notifier start at address 0

Lorenzo Stoakes (ARM) (2):
coda: never point a file's f_mapping at a container's mapping
fs/proc/task_mmu: write-protect only with ptrace attach

Documentation/admin-guide/mm/pagemap.rst | 4 ++-
fs/coda/file.c | 14 +++++++++-
fs/proc/task_mmu.c | 47 ++++++++++++++++++++++++++++----
mm/madvise.c | 19 +++++++++----
mm/mprotect.c | 8 +++---
5 files changed, 75 insertions(+), 17 deletions(-)
---
base-commit: c6f53520f32302ea64cbcfd7cc25a31081e34548
change-id: 20261127-mlock-madvise-mprotect-ai-fixes-efebbfabe99c

Cheers,
--
Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>