From: Greg Kroah-Hartman Date: Tue, 9 Jun 2020 18:59:42 +0000 (+0200) Subject: fix up queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly... X-Git-Tag: v5.7.2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3e1ce6af417200767e67857ee0987d2dce87f2b;p=thirdparty%2Fkernel%2Fstable-queue.git fix up queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch --- diff --git a/queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch b/queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch index 4db997d9874..2b3e1aa09d2 100644 --- a/queue-4.19/uprobes-ensure-that-uprobe-offset-and-ref_ctr_offset-are-properly-aligned.patch +++ b/queue-4.19/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); -@@ -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;