From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754087AbcB2LD0 (ORCPT ); Mon, 29 Feb 2016 06:03:26 -0500 Received: from torg.zytor.com ([198.137.202.12]:53116 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753783AbcB2LC6 (ORCPT ); Mon, 29 Feb 2016 06:02:58 -0500 Date: Mon, 29 Feb 2016 03:02:18 -0800 From: tip-bot for Oleg Nesterov Message-ID: Cc: mingo@kernel.org, tglx@linutronix.de, panand@redhat.com, peterz@infradead.org, oleg@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tipbot@zytor.com, jolsa@redhat.com, torvalds@linux-foundation.org Reply-To: panand@redhat.com, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, tipbot@zytor.com, jolsa@redhat.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, hpa@zytor.com, oleg@redhat.com In-Reply-To: <20160227221128.GA29565@redhat.com> References: <20160227221128.GA29565@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] uprobes: __create_xol_area() must nullify xol_mapping.fault Git-Commit-ID: 869ae76147ffdf21ad24f0e599303cd58a2bb39f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 869ae76147ffdf21ad24f0e599303cd58a2bb39f Gitweb: http://git.kernel.org/tip/869ae76147ffdf21ad24f0e599303cd58a2bb39f Author: Oleg Nesterov AuthorDate: Sat, 27 Feb 2016 23:11:28 +0100 Committer: Ingo Molnar CommitDate: Mon, 29 Feb 2016 08:47:51 +0100 uprobes: __create_xol_area() must nullify xol_mapping.fault As Jiri pointed out, this 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. Suggested-by: Jiri Olsa Reported-by: Jiri Olsa Signed-off-by: Oleg Nesterov Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Pratyush Anand Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20160227221128.GA29565@redhat.com Signed-off-by: Ingo Molnar --- 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])