[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-cc359d180fa9c25a4c1819f17e07a422d788353d@git.kernel.org>
Date: Mon, 18 Jun 2012 01:50:56 -0700
From: tip-bot for Oleg Nesterov <oleg@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, ananth@...ibm.com, anton@...hat.com,
srikar@...ux.vnet.ibm.com, tglx@...utronix.de, oleg@...hat.com
Subject: [tip:perf/core] uprobes: __copy_insn() should ensure a_ops->
readpage != NULL
Commit-ID: cc359d180fa9c25a4c1819f17e07a422d788353d
Gitweb: http://git.kernel.org/tip/cc359d180fa9c25a4c1819f17e07a422d788353d
Author: Oleg Nesterov <oleg@...hat.com>
AuthorDate: Fri, 15 Jun 2012 17:43:25 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 16 Jun 2012 09:10:42 +0200
uprobes: __copy_insn() should ensure a_ops->readpage != NULL
__copy_insn() blindly calls read_mapping_page(), this will crash
the kernel if ->readpage == NULL, add the necessary check. For
example, hugetlbfs_aops->readpage is NULL. Perhaps we should
change read_mapping_page() instead.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
Acked-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
Cc: Anton Arapov <anton@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20120615154325.GA9568@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/uprobes.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index f0d0453..604930b 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -610,6 +610,9 @@ __copy_insn(struct address_space *mapping, struct vm_area_struct *vma, char *ins
if (!filp)
return -EINVAL;
+ if (!mapping->a_ops->readpage)
+ return -EIO;
+
idx = (unsigned long)(offset >> PAGE_CACHE_SHIFT);
off1 = offset &= ~PAGE_MASK;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists