Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+[ check for ref_ctr_offset removed for backport - gregkh ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
---
- kernel/events/uprobes.c | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
+ kernel/events/uprobes.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
smp_wmb(); /* pairs with the smp_rmb() in handle_swbp() */
set_bit(UPROBE_COPY_INSN, &uprobe->flags);
-@@ -911,6 +907,15 @@ static int __uprobe_register(struct inod
+@@ -911,6 +907,13 @@ static int __uprobe_register(struct inod
if (offset > i_size_read(inode))
return -EINVAL;
+ /*
-+ * This ensures that copy_from_page(), copy_to_page() and
-+ * __update_ref_ctr() can't cross page boundary.
++ * This ensures that copy_from_page() and copy_to_page()
++ * can't cross page boundary.
+ */
+ if (!IS_ALIGNED(offset, UPROBE_SWBP_INSN_SIZE))
+ return -EINVAL;
-+ if (!IS_ALIGNED(ref_ctr_offset, sizeof(short)))
-+ return -EINVAL;
+
retry:
uprobe = alloc_uprobe(inode, offset);
if (!uprobe)
-@@ -1708,6 +1713,9 @@ static int is_trap_at_addr(struct mm_str
+@@ -1708,6 +1711,9 @@ static int is_trap_at_addr(struct mm_str
uprobe_opcode_t opcode;
int result;