]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jun 2020 18:59:42 +0000 (20:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jun 2020 18:59:42 +0000 (20:59 +0200)
queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch

index 4db997d987471bfa18b6e90e1312379ccf13268e..2b3e1aa09d27cc6e4f3e147f9ca50560fb721f5f 100644 (file)
@@ -29,11 +29,11 @@ Tested-by: Sven Schnelle <svens@linux.ibm.com>
 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 |   1++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
 
 --- a/kernel/events/uprobes.c
 +++ b/kernel/events/uprobes.c
@@ -48,23 +48,21 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        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;