[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160227221128.GA29565@redhat.com>
Date: Sat, 27 Feb 2016 23:11:28 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andy Lutomirski <tipbot@...or.com>, Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Pratyush Anand <panand@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH tip/x86/asm] uprobes: __create_xol_area() must nullify
xol_mapping.fault
As Jiri pointed out, the recent commit f872f5400cc0 "mm: Add a
vm_special_mapping.fault() method" breaks uprobes. __create_xol_area()
doesn't initialize the new ->fault() method and this obviously leads to
kernel crash when the application tries to execute the probed insn after
bp hit.
We probably want to add uprobes_special_mapping_fault(), this allows to
turn xol_area->xol_mapping into a single instance of vm_special_mapping.
But we need a simple fix, so lets change __create_xol() to nullify the
new member as Jiri suggests.
Reported-by: Jiri Olsa <jolsa@...hat.com>
Suggested-by: Jiri Olsa <jolsa@...hat.com>
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/events/uprobes.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 0167679..5f6ce93 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1178,6 +1178,7 @@ static struct xol_area *__create_xol_area(unsigned long vaddr)
goto free_area;
area->xol_mapping.name = "[uprobes]";
+ area->xol_mapping.fault = NULL;
area->xol_mapping.pages = area->pages;
area->pages[0] = alloc_page(GFP_HIGHUSER);
if (!area->pages[0])
--
2.5.0
Powered by blists - more mailing lists