summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorChris Mason <mason@kernel.org>2026-10-31 10:40:04 +0100
committerDavid Hildenbrand (Arm) <david@kernel.org>2026-11-03 20:20:53 +0100
commit8db6921cc07b74197a3866d62ed262b68aeadcf3 (patch)
tree3fb15fb1256daf1f6973f7f68a483c12de1905e2 /tools/lib/python
parent22d043c1da48d6c7274f9dd900714b6d58b7b9c6 (diff)
mm/memory: reject remote COW faults on PFN mappings
When handling a COW fault without a normal source page (PFN mappings), __wp_page_copy_user() copies from the faulting user address. For remote faults, this accesses the wrong address space, resulting in wrong data getting copied. For example, user_events updates an enable bit in the registering process's memory. If that memory needs to be faulted in, user_event_enabler_fault_fixup() calls fixup_user_fault() from a work item. Placing the enable bit in a private PFN mapping can trigger this remote COW path. Reject these faults with VM_FAULT_SIGBUS when the target mm differs from current->mm: remote faults. Ordinary (non-PFN) mappings are not affected. The user-address copy dates back to commit 6aab341e0a28 ("mm: re-architect the VM_UNPAGED logic"); likely, actual ways to get remote faults in there on COW PFN mappings appeared afterwards. But the fix is simple and straight forward. Fix generated by an LLM and sent by Chris Mason in private. Fixes: 6aab341e0a28 ("mm: re-architect the VM_UNPAGED logic") Cc: stable@vger.kernel.org Signed-off-by: Chris Mason <mason@kernel.org> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> [ david: simplify comment and description ] Reviewed-by: Pedro Falcato <pfalcato@suse.de> Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com> Link: https://patch.msgid.link/20261031-fixes_core-v3-35-d6437171ecc3@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions