]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uprobes: deny mremap(xol_vma)
authorOleg Nesterov <oleg@redhat.com>
Sun, 29 Sep 2024 14:42:58 +0000 (16:42 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 7 Oct 2024 07:28:45 +0000 (09:28 +0200)
commitc16e2fdd746c78f5b2ce3c2ab8a26a61b6ed09e5
treea55a14d258a9f1f88c31a21aeb2628f0d29e86c1
parentc5356ab1db28cafc448a50c26ba84442237abb98
uprobes: deny mremap(xol_vma)

kernel/events/uprobes.c assumes that xol_area->vaddr is always correct but
a malicious application can remap its "[uprobes]" vma to another adress to
confuse the kernel. Introduce xol_mremap() to make this impossible.

With this change utask->xol_vaddr in xol_free_insn_slot() can't be invalid,
we can turn the offset check into WARN_ON_ONCE(offset >= PAGE_SIZE).

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240929144258.GA9492@redhat.com
kernel/events/uprobes.c