From: Greg Kroah-Hartman Date: Wed, 4 Sep 2019 10:32:38 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.4.191~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bfcf6007252ed3d61ce271db679ee4c3beee11f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: x86-ptrace-fix-up-botched-merge-of-spectrev1-fix.patch --- diff --git a/queue-4.19/series b/queue-4.19/series index 8193a9008d3..62b51ae1a28 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -89,3 +89,4 @@ nfsv4-pnfs-fix-a-page-lock-leak-in-nfs_pageio_resend.patch nfs-pass-error-information-to-the-pgio-error-cleanup.patch nfs-ensure-o_direct-reports-an-error-if-the-bytes-re.patch i2c-piix4-fix-port-selection-for-amd-family-16h-mode.patch +x86-ptrace-fix-up-botched-merge-of-spectrev1-fix.patch diff --git a/queue-4.19/x86-ptrace-fix-up-botched-merge-of-spectrev1-fix.patch b/queue-4.19/x86-ptrace-fix-up-botched-merge-of-spectrev1-fix.patch new file mode 100644 index 00000000000..618d4a4efa4 --- /dev/null +++ b/queue-4.19/x86-ptrace-fix-up-botched-merge-of-spectrev1-fix.patch @@ -0,0 +1,40 @@ +From d91372b3cc092fb573ad0ed3edba584dcc3913da Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 4 Sep 2019 12:27:18 +0200 +Subject: x86/ptrace: fix up botched merge of spectrev1 fix + +From: Greg Kroah-Hartman + +I incorrectly merged commit 31a2fbb390fe ("x86/ptrace: Fix possible +spectre-v1 in ptrace_get_debugreg()") when backporting it, as was +graciously pointed out at +https://grsecurity.net/teardown_of_a_failed_linux_lts_spectre_fix.php + +Resolve the upstream difference with the stable kernel merge to properly +protect things. + +Reported-by: Brad Spengler +Cc: Dianzhang Chen +Cc: Thomas Gleixner +Cc: +Cc: +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/ptrace.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/x86/kernel/ptrace.c ++++ b/arch/x86/kernel/ptrace.c +@@ -652,11 +652,10 @@ static unsigned long ptrace_get_debugreg + { + struct thread_struct *thread = &tsk->thread; + unsigned long val = 0; +- int index = n; + + if (n < HBP_NUM) { ++ int index = array_index_nospec(n, HBP_NUM); + struct perf_event *bp = thread->ptrace_bps[index]; +- index = array_index_nospec(index, HBP_NUM); + + if (bp) + val = bp->hw.info.address;