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);
-@@ -894,6 +890,15 @@ int uprobe_register(struct inode *inode,
+@@ -894,6 +890,13 @@ int uprobe_register(struct inode *inode,
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)
-@@ -1704,6 +1709,9 @@ static int is_trap_at_addr(struct mm_str
+@@ -1704,6 +1707,9 @@ static int is_trap_at_addr(struct mm_str
uprobe_opcode_t opcode;
int result;
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);
-@@ -884,6 +880,15 @@ int uprobe_register(struct inode *inode,
+@@ -884,6 +880,13 @@ int uprobe_register(struct inode *inode,
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)
-@@ -1692,6 +1697,9 @@ static int is_trap_at_addr(struct mm_str
+@@ -1692,6 +1695,9 @@ static int is_trap_at_addr(struct mm_str
uprobe_opcode_t opcode;
int result;
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);
-@@ -886,6 +882,15 @@ int uprobe_register(struct inode *inode,
+@@ -886,6 +882,13 @@ int uprobe_register(struct inode *inode,
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)
-@@ -1696,6 +1701,9 @@ static int is_trap_at_addr(struct mm_str
+@@ -1696,6 +1699,9 @@ static int is_trap_at_addr(struct mm_str
uprobe_opcode_t opcode;
int result;