]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up more uprobes patches...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jun 2020 19:06:53 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jun 2020 19:06:53 +0000 (21:06 +0200)
queue-4.14/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch
queue-4.4/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch
queue-4.9/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch

index b6ef2e5baf77576868f02edc675cb702ec4a84c9..a10db0317d4ee2dc3d3dbdcbbb998596cf6616f1 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);
  
-@@ -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;
  
index 4581228a7cf7bd34d45b955321992524b01e4767..fe19fd9261184ebd6a21dcafa44274b127a3fd81 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);
  
-@@ -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;
  
index 6a742a8285c08a9d8438106b589367d33b77209e..5ada51063c2cb14c749cc01ade805ec2349f65d3 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);
  
-@@ -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;