From: Greg Kroah-Hartman Date: Tue, 9 Jun 2020 19:06:53 +0000 (+0200) Subject: fix up more uprobes patches... X-Git-Tag: v5.7.2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0afb6aa9eae929f4045cb34eddf62ccc2c6faeb;p=thirdparty%2Fkernel%2Fstable-queue.git fix up more uprobes patches... --- diff --git a/queue-4.14/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch b/queue-4.14/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch index b6ef2e5baf7..a10db0317d4 100644 --- a/queue-4.14/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch +++ b/queue-4.14/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch @@ -29,11 +29,11 @@ Tested-by: Sven Schnelle Cc: Steven Rostedt Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds +[ check for ref_ctr_offset removed for backport - gregkh ] Signed-off-by: Greg Kroah-Hartman - --- - 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 @@ -48,23 +48,21 @@ Signed-off-by: Greg Kroah-Hartman 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; diff --git a/queue-4.4/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch b/queue-4.4/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch index 4581228a7cf..fe19fd92611 100644 --- a/queue-4.4/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch +++ b/queue-4.4/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch @@ -29,11 +29,11 @@ Tested-by: Sven Schnelle Cc: Steven Rostedt Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds +[ check for ref_ctr_offset removed for backport - gregkh ] Signed-off-by: Greg Kroah-Hartman - --- - 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 @@ -48,23 +48,21 @@ Signed-off-by: Greg Kroah-Hartman 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; diff --git a/queue-4.9/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch b/queue-4.9/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch index 6a742a8285c..5ada51063c2 100644 --- a/queue-4.9/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch +++ b/queue-4.9/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch @@ -29,11 +29,11 @@ Tested-by: Sven Schnelle Cc: Steven Rostedt Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds +[ check for ref_ctr_offset removed for backport - gregkh ] Signed-off-by: Greg Kroah-Hartman - --- - 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 @@ -48,23 +48,21 @@ Signed-off-by: Greg Kroah-Hartman 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;