Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-05-22 07:07:09 +0200
committerKernel Build Daemon <kbuild@suse.de>2019-05-22 07:07:09 +0200
commit7cb1ce6bec603c8d64f4c08902bb449840a83b97 (patch)
tree82d4851e46a7b82ec702289c1ea709a2529e8eba
parentf48ec14f1192ad3a8729a34279aa761b7f084c62 (diff)
parent19a09ba6f064c03c926fabdaaed44ea1955bdda5 (diff)
Merge branch 'SLE15' into openSUSE-15.0
-rw-r--r--blacklist.conf1
-rw-r--r--patches.arch/kvm-x86-report-stibp-on-get_supported_cpuid.patch2
-rw-r--r--patches.arch/locking-atomics-asm-generic-move-some-macros-from-linux-bitops-h-to-a-new-linux-bits-h-file.patch2
-rw-r--r--patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch2
-rw-r--r--patches.arch/x86-kvm-expose-x86_feature_md_clear-to-guests.patch2
-rw-r--r--patches.arch/x86-kvm-vmx-add-mds-protection-when-l1d-flush-is-not-active.patch2
-rw-r--r--patches.arch/x86-msr-index-cleanup-bit-defines.patch2
-rw-r--r--patches.arch/x86-speculation-consolidate-cpu-whitelists.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-basic-bug-infrastructure-for-mds.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-bug_msbds_only.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-mds-full-nosmt-cmdline-option.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-mds_clear_cpu_buffers.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-mitigation-control-for-mds.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-mitigation-mode-vmwerv.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-mitigations-support-for-mds.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-smt-warning-message.patch2
-rw-r--r--patches.arch/x86-speculation-mds-add-sysfs-reporting-for-mds.patch2
-rw-r--r--patches.arch/x86-speculation-mds-clear-cpu-buffers-on-exit-to-user.patch2
-rw-r--r--patches.arch/x86-speculation-mds-conditionally-clear-cpu-buffers-on-idle-entry.patch2
-rw-r--r--patches.arch/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch2
-rw-r--r--patches.arch/x86-speculation-move-arch_smt_update-call-to-after-mitigation-decisions.patch2
-rw-r--r--patches.arch/x86-speculation-simplify-the-cpu-bug-detection-logic.patch2
-rw-r--r--patches.drivers/serial-fix-race-between-flush_to_ldisc-and-tty_open.patch4
-rw-r--r--patches.drivers/soc-fsl-qe-Fix-an-error-code-in-qe_pin_request.patch38
-rw-r--r--patches.fixes/vsock-virtio-Initialize-core-virtio-vsock-before-reg.patch113
-rw-r--r--patches.suse/TTY-serial_core-add-install.patch128
-rw-r--r--patches.suse/btrfs-do-not-allow-trimming-when-a-fs-is-mounted-wit.patch55
-rw-r--r--patches.suse/btrfs-improve-performance-on-fsync-of-files-with-mul.patch362
-rw-r--r--patches.suse/btrfs-send-flush-dellaloc-in-order-to-avoid-data-los.patch136
-rw-r--r--series.conf6
30 files changed, 862 insertions, 23 deletions
diff --git a/blacklist.conf b/blacklist.conf
index 5173cce52b..7f745bdd04 100644
--- a/blacklist.conf
+++ b/blacklist.conf
@@ -64,6 +64,7 @@ drivers/ide # IDE not shipped since SLE12
# -----------------------
CVE-2018-16880 # bsc#1122767, needed only for SLE15-SP1+
CVE-2019-9003 # bsc#1126704, needed only for SLE15-SP1+
+CVE-2019-11811 # bsc#1134397, needed only for SLE15-SP1+
# Blacklisted Commits
# -------------------
diff --git a/patches.arch/kvm-x86-report-stibp-on-get_supported_cpuid.patch b/patches.arch/kvm-x86-report-stibp-on-get_supported_cpuid.patch
index bec39883f1..cf5063beee 100644
--- a/patches.arch/kvm-x86-report-stibp-on-get_supported_cpuid.patch
+++ b/patches.arch/kvm-x86-report-stibp-on-get_supported_cpuid.patch
@@ -3,7 +3,7 @@ Date: Wed, 5 Dec 2018 17:19:56 -0200
Subject: kvm: x86: Report STIBP on GET_SUPPORTED_CPUID
Git-commit: d7b09c827a6cf291f66637a36f46928dd1423184
Patch-mainline: v5.0-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Months ago, we have added code to allow direct access to MSR_IA32_SPEC_CTRL
to the guest, which makes STIBP available to guests. This was implemented
diff --git a/patches.arch/locking-atomics-asm-generic-move-some-macros-from-linux-bitops-h-to-a-new-linux-bits-h-file.patch b/patches.arch/locking-atomics-asm-generic-move-some-macros-from-linux-bitops-h-to-a-new-linux-bits-h-file.patch
index e431bdf60d..cec803db31 100644
--- a/patches.arch/locking-atomics-asm-generic-move-some-macros-from-linux-bitops-h-to-a-new-linux-bits-h-file.patch
+++ b/patches.arch/locking-atomics-asm-generic-move-some-macros-from-linux-bitops-h-to-a-new-linux-bits-h-file.patch
@@ -4,7 +4,7 @@ Subject: locking/atomics, asm-generic: Move some macros from <linux/bitops.h>
to a new <linux/bits.h> file
Git-commit: 8bd9cb51daac89337295b6f037b0486911e1b408
Patch-mainline: v4.19-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
In preparation for implementing the asm-generic atomic bitops in terms
of atomic_long_*(), we need to prevent <asm/atomic.h> implementations from
diff --git a/patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch b/patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch
index 5cdecdb444..70223a4371 100644
--- a/patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch
+++ b/patches.arch/x86-cpu-sanitize-fam6_atom-naming.patch
@@ -3,7 +3,7 @@ Date: Tue, 7 Aug 2018 10:17:27 -0700
Subject: x86/cpu: Sanitize FAM6_ATOM naming
Git-commit: f2c4db1bd80720cd8cb2a5aa220d9bc9f374f04e
Patch-mainline: v5.1-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
commit f2c4db1bd80720cd8cb2a5aa220d9bc9f374f04e upstream
diff --git a/patches.arch/x86-kvm-expose-x86_feature_md_clear-to-guests.patch b/patches.arch/x86-kvm-expose-x86_feature_md_clear-to-guests.patch
index 551ba9ae99..81e943fc30 100644
--- a/patches.arch/x86-kvm-expose-x86_feature_md_clear-to-guests.patch
+++ b/patches.arch/x86-kvm-expose-x86_feature_md_clear-to-guests.patch
@@ -3,7 +3,7 @@ Date: Fri, 18 Jan 2019 16:50:23 -0800
Subject: x86/kvm: Expose X86_FEATURE_MD_CLEAR to guests
Git-commit: 6c4dbbd14730c43f4ed808a9c42ca41625925c22
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
X86_FEATURE_MD_CLEAR is a new CPUID bit which is set when microcode
provides the mechanism to invoke a flush of various exploitable CPU buffers
diff --git a/patches.arch/x86-kvm-vmx-add-mds-protection-when-l1d-flush-is-not-active.patch b/patches.arch/x86-kvm-vmx-add-mds-protection-when-l1d-flush-is-not-active.patch
index 29ec748a0f..bd2e7c97e7 100644
--- a/patches.arch/x86-kvm-vmx-add-mds-protection-when-l1d-flush-is-not-active.patch
+++ b/patches.arch/x86-kvm-vmx-add-mds-protection-when-l1d-flush-is-not-active.patch
@@ -3,7 +3,7 @@ Date: Wed, 27 Feb 2019 12:48:14 +0100
Subject: x86/kvm/vmx: Add MDS protection when L1D Flush is not active
Git-commit: 650b68a0622f933444a6d66936abb3103029413b
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
CPUs which are affected by L1TF and MDS mitigate MDS with the L1D Flush on
VMENTER when updated microcode is installed.
diff --git a/patches.arch/x86-msr-index-cleanup-bit-defines.patch b/patches.arch/x86-msr-index-cleanup-bit-defines.patch
index 9f5a73614e..8552aa7dfe 100644
--- a/patches.arch/x86-msr-index-cleanup-bit-defines.patch
+++ b/patches.arch/x86-msr-index-cleanup-bit-defines.patch
@@ -3,7 +3,7 @@ Date: Thu, 21 Feb 2019 12:36:50 +0100
Subject: x86/msr-index: Cleanup bit defines
Git-commit: d8eabc37310a92df40d07c5a8afc53cebf996716
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Greg pointed out that speculation related bit defines are using (1 << N)
format instead of BIT(N). Aside of that (1 << N) is wrong as it should use
diff --git a/patches.arch/x86-speculation-consolidate-cpu-whitelists.patch b/patches.arch/x86-speculation-consolidate-cpu-whitelists.patch
index f30478b90b..9662a8077a 100644
--- a/patches.arch/x86-speculation-consolidate-cpu-whitelists.patch
+++ b/patches.arch/x86-speculation-consolidate-cpu-whitelists.patch
@@ -3,7 +3,7 @@ Date: Wed, 27 Feb 2019 10:10:23 +0100
Subject: x86/speculation: Consolidate CPU whitelists
Git-commit: 36ad35131adacc29b328b9c8b6277a8bf0d6fd5d
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
The CPU vulnerability whitelists have some overlap and there are more
whitelists coming along.
diff --git a/patches.arch/x86-speculation-mds-add-basic-bug-infrastructure-for-mds.patch b/patches.arch/x86-speculation-mds-add-basic-bug-infrastructure-for-mds.patch
index fad4ad16e9..736111e827 100644
--- a/patches.arch/x86-speculation-mds-add-basic-bug-infrastructure-for-mds.patch
+++ b/patches.arch/x86-speculation-mds-add-basic-bug-infrastructure-for-mds.patch
@@ -3,7 +3,7 @@ Date: Fri, 18 Jan 2019 16:50:16 -0800
Subject: x86/speculation/mds: Add basic bug infrastructure for MDS
Git-commit: ed5194c2732c8084af9fd159c146ea92bf137128
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Microarchitectural Data Sampling (MDS), is a class of side channel attacks
on internal buffers in Intel CPUs. The variants are:
diff --git a/patches.arch/x86-speculation-mds-add-bug_msbds_only.patch b/patches.arch/x86-speculation-mds-add-bug_msbds_only.patch
index de1249b660..7dd8ba527c 100644
--- a/patches.arch/x86-speculation-mds-add-bug_msbds_only.patch
+++ b/patches.arch/x86-speculation-mds-add-bug_msbds_only.patch
@@ -3,7 +3,7 @@ Date: Fri, 1 Mar 2019 20:21:08 +0100
Subject: x86/speculation/mds: Add BUG_MSBDS_ONLY
Git-commit: e261f209c3666e842fd645a1e31f001c3a26def9
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
This bug bit is set on CPUs which are only affected by Microarchitectural
Store Buffer Data Sampling (MSBDS) and not by any other MDS variant.
diff --git a/patches.arch/x86-speculation-mds-add-mds-full-nosmt-cmdline-option.patch b/patches.arch/x86-speculation-mds-add-mds-full-nosmt-cmdline-option.patch
index dec6360c5c..5c918bf56f 100644
--- a/patches.arch/x86-speculation-mds-add-mds-full-nosmt-cmdline-option.patch
+++ b/patches.arch/x86-speculation-mds-add-mds-full-nosmt-cmdline-option.patch
@@ -3,7 +3,7 @@ Date: Tue, 2 Apr 2019 09:59:33 -0500
Subject: x86/speculation/mds: Add mds=full,nosmt cmdline option
Git-commit: d71eb0ce109a124b0fa714832823b9452f2762cf
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Add the mds=full,nosmt cmdline option. This is like mds=full, but with
SMT disabled if the CPU is vulnerable.
diff --git a/patches.arch/x86-speculation-mds-add-mds_clear_cpu_buffers.patch b/patches.arch/x86-speculation-mds-add-mds_clear_cpu_buffers.patch
index a92f385657..acb480422a 100644
--- a/patches.arch/x86-speculation-mds-add-mds_clear_cpu_buffers.patch
+++ b/patches.arch/x86-speculation-mds-add-mds_clear_cpu_buffers.patch
@@ -3,7 +3,7 @@ Date: Mon, 18 Feb 2019 23:13:06 +0100
Subject: x86/speculation/mds: Add mds_clear_cpu_buffers()
Git-commit: 6a9e529272517755904b7afa639f6db59ddb793e
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
The Microarchitectural Data Sampling (MDS) vulernabilities are mitigated by
clearing the affected CPU buffers. The mechanism for clearing the buffers
diff --git a/patches.arch/x86-speculation-mds-add-mitigation-control-for-mds.patch b/patches.arch/x86-speculation-mds-add-mitigation-control-for-mds.patch
index 4854312bca..dff5a6ac26 100644
--- a/patches.arch/x86-speculation-mds-add-mitigation-control-for-mds.patch
+++ b/patches.arch/x86-speculation-mds-add-mitigation-control-for-mds.patch
@@ -3,7 +3,7 @@ Date: Mon, 18 Feb 2019 22:04:08 +0100
Subject: x86/speculation/mds: Add mitigation control for MDS
Git-commit: bc1241700acd82ec69fde98c5763ce51086269f8
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Now that the mitigations are in place, add a command line parameter to
control the mitigation, a mitigation selector function and a SMT update
diff --git a/patches.arch/x86-speculation-mds-add-mitigation-mode-vmwerv.patch b/patches.arch/x86-speculation-mds-add-mitigation-mode-vmwerv.patch
index 67da3599f5..1e3397de1c 100644
--- a/patches.arch/x86-speculation-mds-add-mitigation-mode-vmwerv.patch
+++ b/patches.arch/x86-speculation-mds-add-mitigation-mode-vmwerv.patch
@@ -3,7 +3,7 @@ Date: Wed, 20 Feb 2019 09:40:40 +0100
Subject: x86/speculation/mds: Add mitigation mode VMWERV
Git-commit: 22dd8365088b6403630b82423cf906491859b65e
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
In virtualized environments it can happen that the host has the microcode
update which utilizes the VERW instruction to clear CPU buffers, but the
diff --git a/patches.arch/x86-speculation-mds-add-mitigations-support-for-mds.patch b/patches.arch/x86-speculation-mds-add-mitigations-support-for-mds.patch
index 3f3718f858..abb38f06fe 100644
--- a/patches.arch/x86-speculation-mds-add-mitigations-support-for-mds.patch
+++ b/patches.arch/x86-speculation-mds-add-mitigations-support-for-mds.patch
@@ -3,7 +3,7 @@ Date: Wed, 17 Apr 2019 16:39:02 -0500
Subject: x86/speculation/mds: Add 'mitigations=' support for MDS
Git-commit: 5c14068f87d04adc73ba3f41c2a303d3c3d1fa12
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Add MDS to the new 'mitigations=' cmdline option.
diff --git a/patches.arch/x86-speculation-mds-add-smt-warning-message.patch b/patches.arch/x86-speculation-mds-add-smt-warning-message.patch
index 28772aceeb..fd6806f607 100644
--- a/patches.arch/x86-speculation-mds-add-smt-warning-message.patch
+++ b/patches.arch/x86-speculation-mds-add-smt-warning-message.patch
@@ -3,7 +3,7 @@ Date: Tue, 2 Apr 2019 10:00:51 -0500
Subject: x86/speculation/mds: Add SMT warning message
Git-commit: 39226ef02bfb43248b7db12a4fdccb39d95318e3
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
MDS is vulnerable with SMT. Make that clear with a one-time printk
whenever SMT first gets enabled.
diff --git a/patches.arch/x86-speculation-mds-add-sysfs-reporting-for-mds.patch b/patches.arch/x86-speculation-mds-add-sysfs-reporting-for-mds.patch
index f0fa6a4e0b..163d8311e7 100644
--- a/patches.arch/x86-speculation-mds-add-sysfs-reporting-for-mds.patch
+++ b/patches.arch/x86-speculation-mds-add-sysfs-reporting-for-mds.patch
@@ -3,7 +3,7 @@ Date: Mon, 18 Feb 2019 22:51:43 +0100
Subject: x86/speculation/mds: Add sysfs reporting for MDS
Git-commit: 8a4b06d391b0a42a373808979b5028f5c84d9c6a
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Add the sysfs reporting file for MDS. It exposes the vulnerability and
mitigation state similar to the existing files for the other speculative
diff --git a/patches.arch/x86-speculation-mds-clear-cpu-buffers-on-exit-to-user.patch b/patches.arch/x86-speculation-mds-clear-cpu-buffers-on-exit-to-user.patch
index 38c5a27958..5ee1d96733 100644
--- a/patches.arch/x86-speculation-mds-clear-cpu-buffers-on-exit-to-user.patch
+++ b/patches.arch/x86-speculation-mds-clear-cpu-buffers-on-exit-to-user.patch
@@ -3,7 +3,7 @@ Date: Mon, 18 Feb 2019 23:42:51 +0100
Subject: x86/speculation/mds: Clear CPU buffers on exit to user
Git-commit: 04dcbdb8057827b043b3c71aa397c4c63e67d086
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Add a static key which controls the invocation of the CPU buffer clear
mechanism on exit to user space and add the call into
diff --git a/patches.arch/x86-speculation-mds-conditionally-clear-cpu-buffers-on-idle-entry.patch b/patches.arch/x86-speculation-mds-conditionally-clear-cpu-buffers-on-idle-entry.patch
index e89ae29353..09385844b6 100644
--- a/patches.arch/x86-speculation-mds-conditionally-clear-cpu-buffers-on-idle-entry.patch
+++ b/patches.arch/x86-speculation-mds-conditionally-clear-cpu-buffers-on-idle-entry.patch
@@ -3,7 +3,7 @@ Date: Mon, 18 Feb 2019 23:04:01 +0100
Subject: x86/speculation/mds: Conditionally clear CPU buffers on idle entry
Git-commit: 07f07f55a29cb705e221eda7894dd67ab81ef343
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Add a static key which controls the invocation of the CPU buffer clear
mechanism on idle entry. This is independent of other MDS mitigations
diff --git a/patches.arch/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch b/patches.arch/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch
index 8ad7e115fb..080d53e2d0 100644
--- a/patches.arch/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch
+++ b/patches.arch/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch
@@ -3,7 +3,7 @@ Date: Fri, 12 Apr 2019 17:50:58 -0400
Subject: x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off
Git-commit: e2c3c94788b08891dcf3dbe608f9880523ecd71b
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
This code is only for CPUs which are affected by MSBDS, but are *not*
affected by the other two MDS issues.
diff --git a/patches.arch/x86-speculation-move-arch_smt_update-call-to-after-mitigation-decisions.patch b/patches.arch/x86-speculation-move-arch_smt_update-call-to-after-mitigation-decisions.patch
index 90fe611911..a0516bdfdc 100644
--- a/patches.arch/x86-speculation-move-arch_smt_update-call-to-after-mitigation-decisions.patch
+++ b/patches.arch/x86-speculation-move-arch_smt_update-call-to-after-mitigation-decisions.patch
@@ -3,7 +3,7 @@ Date: Tue, 2 Apr 2019 10:00:14 -0500
Subject: x86/speculation: Move arch_smt_update() call to after mitigation decisions
Git-commit: 7c3658b20194a5b3209a143f63bc9c643c6a3ae2
Patch-mainline: v5.2-rc1
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
arch_smt_update() now has a dependency on both Spectre v2 and MDS
mitigations. Move its initial call to after all the mitigation decisions
diff --git a/patches.arch/x86-speculation-simplify-the-cpu-bug-detection-logic.patch b/patches.arch/x86-speculation-simplify-the-cpu-bug-detection-logic.patch
index 2ca003db81..1182e16ed4 100644
--- a/patches.arch/x86-speculation-simplify-the-cpu-bug-detection-logic.patch
+++ b/patches.arch/x86-speculation-simplify-the-cpu-bug-detection-logic.patch
@@ -3,7 +3,7 @@ Date: Tue, 22 May 2018 11:05:39 +0200
Subject: x86/speculation: Simplify the CPU bug detection logic
Git-commit: 8ecc4979b1bd9c94168e6fc92960033b7a951336
Patch-mainline: v4.17-rc7
-References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
+References: bsc#1111331, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Only CPUs which speculate can speculate. Therefore, it seems prudent
to test for cpu_no_speculation first and only then determine whether
diff --git a/patches.drivers/serial-fix-race-between-flush_to_ldisc-and-tty_open.patch b/patches.drivers/serial-fix-race-between-flush_to_ldisc-and-tty_open.patch
index 8730ce5efd..d8580a7a50 100644
--- a/patches.drivers/serial-fix-race-between-flush_to_ldisc-and-tty_open.patch
+++ b/patches.drivers/serial-fix-race-between-flush_to_ldisc-and-tty_open.patch
@@ -73,9 +73,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
port = uart_port_lock(state, flags);
__uart_start(tty);
uart_port_unlock(port, flags);
-@@ -2403,6 +2406,9 @@ static void uart_poll_put_char(struct tt
- struct uart_state *state = drv->state + line;
+@@ -719,6 +722,9 @@ static void uart_unthrottle(struct tty_s
struct uart_port *port;
+ upstat_t mask = 0;
+ if (!state)
+ return;
diff --git a/patches.drivers/soc-fsl-qe-Fix-an-error-code-in-qe_pin_request.patch b/patches.drivers/soc-fsl-qe-Fix-an-error-code-in-qe_pin_request.patch
new file mode 100644
index 0000000000..386aed57b4
--- /dev/null
+++ b/patches.drivers/soc-fsl-qe-Fix-an-error-code-in-qe_pin_request.patch
@@ -0,0 +1,38 @@
+From 5674a92ca4b7e5a6a19231edd10298d30324cd27 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 28 Mar 2019 17:18:41 +0300
+Subject: [PATCH] soc/fsl/qe: Fix an error code in qe_pin_request()
+Git-commit: 5674a92ca4b7e5a6a19231edd10298d30324cd27
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+We forgot to set "err" on this error path.
+
+Fixes: 1a2d397a6eb5 ("gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags()")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Li Yang <leoyang.li@nxp.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/soc/fsl/qe/gpio.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c
+index 819bed0f5667..51b3a47b5a55 100644
+--- a/drivers/soc/fsl/qe/gpio.c
++++ b/drivers/soc/fsl/qe/gpio.c
+@@ -179,8 +179,10 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
+ if (err < 0)
+ goto err0;
+ gc = gpio_to_chip(err);
+- if (WARN_ON(!gc))
++ if (WARN_ON(!gc)) {
++ err = -ENODEV;
+ goto err0;
++ }
+
+ if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) {
+ pr_debug("%s: tried to get a non-qe pin\n", __func__);
+--
+2.16.4
+
diff --git a/patches.fixes/vsock-virtio-Initialize-core-virtio-vsock-before-reg.patch b/patches.fixes/vsock-virtio-Initialize-core-virtio-vsock-before-reg.patch
new file mode 100644
index 0000000000..da0d0c5f09
--- /dev/null
+++ b/patches.fixes/vsock-virtio-Initialize-core-virtio-vsock-before-reg.patch
@@ -0,0 +1,113 @@
+From ba95e5dfd36647622d8897a2a0470dde60e59ffd Mon Sep 17 00:00:00 2001
+From: "Jorge E. Moreira" <jemoreira@google.com>
+Date: Thu, 16 May 2019 13:51:07 -0700
+Subject: [PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver
+Git-commit: ba95e5dfd36647622d8897a2a0470dde60e59ffd
+Patch-mainline: v5.2-rc2
+References: bsc#1051510
+
+Avoid a race in which static variables in net/vmw_vsock/af_vsock.c are
+accessed (while handling interrupts) before they are initialized.
+
+[ 4.201410] BUG: unable to handle kernel paging request at ffffffffffffffe8
+[ 4.207829] IP: vsock_addr_equals_addr+0x3/0x20
+[ 4.211379] PGD 28210067 P4D 28210067 PUD 28212067 PMD 0
+[ 4.211379] Oops: 0000 [#1] PREEMPT SMP PTI
+[ 4.211379] Modules linked in:
+[ 4.211379] CPU: 1 PID: 30 Comm: kworker/1:1 Not tainted 4.14.106-419297-gd7e28cc1f241 #1
+[ 4.211379] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
+[ 4.211379] Workqueue: virtio_vsock virtio_transport_rx_work
+[ 4.211379] task: ffffa3273d175280 task.stack: ffffaea1800e8000
+[ 4.211379] RIP: 0010:vsock_addr_equals_addr+0x3/0x20
+[ 4.211379] RSP: 0000:ffffaea1800ebd28 EFLAGS: 00010286
+[ 4.211379] RAX: 0000000000000002 RBX: 0000000000000000 RCX: ffffffffb94e42f0
+[ 4.211379] RDX: 0000000000000400 RSI: ffffffffffffffe0 RDI: ffffaea1800ebdd0
+[ 4.211379] RBP: ffffaea1800ebd58 R08: 0000000000000001 R09: 0000000000000001
+[ 4.211379] R10: 0000000000000000 R11: ffffffffb89d5d60 R12: ffffaea1800ebdd0
+[ 4.211379] R13: 00000000828cbfbf R14: 0000000000000000 R15: ffffaea1800ebdc0
+[ 4.211379] FS: 0000000000000000(0000) GS:ffffa3273fd00000(0000) knlGS:0000000000000000
+[ 4.211379] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[ 4.211379] CR2: ffffffffffffffe8 CR3: 000000002820e001 CR4: 00000000001606e0
+[ 4.211379] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+[ 4.211379] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+[ 4.211379] Call Trace:
+[ 4.211379] ? vsock_find_connected_socket+0x6c/0xe0
+[ 4.211379] virtio_transport_recv_pkt+0x15f/0x740
+[ 4.211379] ? detach_buf+0x1b5/0x210
+[ 4.211379] virtio_transport_rx_work+0xb7/0x140
+[ 4.211379] process_one_work+0x1ef/0x480
+[ 4.211379] worker_thread+0x312/0x460
+[ 4.211379] kthread+0x132/0x140
+[ 4.211379] ? process_one_work+0x480/0x480
+[ 4.211379] ? kthread_destroy_worker+0xd0/0xd0
+[ 4.211379] ret_from_fork+0x35/0x40
+[ 4.211379] Code: c7 47 08 00 00 00 00 66 c7 07 28 00 c7 47 08 ff ff ff ff c7 47 04 ff ff ff ff c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 8b 47 08 <3b> 46 08 75 0a 8b 47 04 3b 46 04 0f 94 c0 c3 31 c0 c3 90 66 2e
+[ 4.211379] RIP: vsock_addr_equals_addr+0x3/0x20 RSP: ffffaea1800ebd28
+[ 4.211379] CR2: ffffffffffffffe8
+[ 4.211379] ---[ end trace f31cc4a2e6df3689 ]---
+[ 4.211379] Kernel panic - not syncing: Fatal exception in interrupt
+[ 4.211379] Kernel Offset: 0x37000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
+[ 4.211379] Rebooting in 5 seconds..
+
+Fixes: 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug")
+Cc: Stefan Hajnoczi <stefanha@redhat.com>
+Cc: Stefano Garzarella <sgarzare@redhat.com>
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: kvm@vger.kernel.org
+Cc: virtualization@lists.linux-foundation.org
+Cc: netdev@vger.kernel.org
+Cc: kernel-team@android.com
+Cc: stable@vger.kernel.org [4.9+]
+Signed-off-by: Jorge E. Moreira <jemoreira@google.com>
+Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
+Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
+Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ net/vmw_vsock/virtio_transport.c | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
+index 15eb5d3d4750..96ab344f17bb 100644
+--- a/net/vmw_vsock/virtio_transport.c
++++ b/net/vmw_vsock/virtio_transport.c
+@@ -702,28 +702,27 @@ static int __init virtio_vsock_init(void)
+ if (!virtio_vsock_workqueue)
+ return -ENOMEM;
+
+- ret = register_virtio_driver(&virtio_vsock_driver);
++ ret = vsock_core_init(&virtio_transport.transport);
+ if (ret)
+ goto out_wq;
+
+- ret = vsock_core_init(&virtio_transport.transport);
++ ret = register_virtio_driver(&virtio_vsock_driver);
+ if (ret)
+- goto out_vdr;
++ goto out_vci;
+
+ return 0;
+
+-out_vdr:
+- unregister_virtio_driver(&virtio_vsock_driver);
++out_vci:
++ vsock_core_exit();
+ out_wq:
+ destroy_workqueue(virtio_vsock_workqueue);
+ return ret;
+-
+ }
+
+ static void __exit virtio_vsock_exit(void)
+ {
+- vsock_core_exit();
+ unregister_virtio_driver(&virtio_vsock_driver);
++ vsock_core_exit();
+ destroy_workqueue(virtio_vsock_workqueue);
+ }
+
+--
+2.16.4
+
diff --git a/patches.suse/TTY-serial_core-add-install.patch b/patches.suse/TTY-serial_core-add-install.patch
new file mode 100644
index 0000000000..c70ad23c1a
--- /dev/null
+++ b/patches.suse/TTY-serial_core-add-install.patch
@@ -0,0 +1,128 @@
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Wed, 17 Apr 2019 10:58:53 +0200
+Subject: TTY: serial_core, add ->install
+Git-commit: 4cdd17ba1dff20ffc99fdbd2e6f0201fc7fe67df
+Patch-mainline: v5.2-rc1
+References: bnc#1129693
+
+We need to compute the uart state only on the first open. This is
+usually what is done in the ->install hook. serial_core used to do this
+in ->open on every open. So move it to ->install.
+
+As a side effect, it ensures the state is set properly in the window
+after tty_init_dev is called, but before uart_open. This fixes a bunch
+of races between tty_open and flush_to_ldisc we were dealing with
+recently.
+
+One of such bugs was attempted to fix in commit fedb5760648a (serial:
+fix race between flush_to_ldisc and tty_open), but it only took care of
+a couple of functions (uart_start and uart_unthrottle). I was able to
+reproduce the crash on a SLE system, but in uart_write_room which is
+also called from flush_to_ldisc via process_echoes. I was *unable* to
+reproduce the bug locally. It is due to having this patch in my queue
+since 2012!
+
+ general protection fault: 0000 [#1] SMP KASAN PTI
+ CPU: 1 PID: 5 Comm: kworker/u4:0 Tainted: G L 4.12.14-396-default #1 SLE15-SP1 (unreleased)
+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-0-ga698c89-prebuilt.qemu.org 04/01/2014
+ Workqueue: events_unbound flush_to_ldisc
+ task: ffff8800427d8040 task.stack: ffff8800427f0000
+ RIP: 0010:uart_write_room+0xc4/0x590
+ RSP: 0018:ffff8800427f7088 EFLAGS: 00010202
+ RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
+ RDX: 000000000000002f RSI: 00000000000000ee RDI: ffff88003888bd90
+ RBP: ffffffffb9545850 R08: 0000000000000001 R09: 0000000000000400
+ R10: ffff8800427d825c R11: 000000000000006e R12: 1ffff100084fee12
+ R13: ffffc900004c5000 R14: ffff88003888bb28 R15: 0000000000000178
+ FS: 0000000000000000(0000) GS:ffff880043300000(0000) knlGS:0000000000000000
+ CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+ CR2: 0000561da0794148 CR3: 000000000ebf4000 CR4: 00000000000006e0
+ Call Trace:
+ tty_write_room+0x6d/0xc0
+ __process_echoes+0x55/0x870
+ n_tty_receive_buf_common+0x105e/0x26d0
+ tty_ldisc_receive_buf+0xb7/0x1c0
+ tty_port_default_receive_buf+0x107/0x180
+ flush_to_ldisc+0x35d/0x5c0
+...
+
+0 in rbx means tty->driver_data is NULL in uart_write_room. 0x178 is
+tried to be dereferenced (0x178 >> 3 is 0x2f in rdx) at
+uart_write_room+0xc4. 0x178 is exactly (struct uart_state *)NULL->refcount
+used in uart_port_lock from uart_write_room.
+
+So revert the upstream commit here as my local patch should fix the
+whole family.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Cc: Li RongQing <lirongqing@baidu.com>
+Cc: Wang Li <wangli39@baidu.com>
+Cc: Zhang Yu <zhangyu31@baidu.com>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/serial_core.c | 24 +++++++++++++-----------
+ 1 file changed, 13 insertions(+), 11 deletions(-)
+
+--- a/drivers/tty/serial/serial_core.c
++++ b/drivers/tty/serial/serial_core.c
+@@ -143,9 +143,6 @@ static void uart_start(struct tty_struct
+ struct uart_port *port;
+ unsigned long flags;
+
+- if (!state)
+- return;
+-
+ port = uart_port_lock(state, flags);
+ __uart_start(tty);
+ uart_port_unlock(port, flags);
+@@ -722,9 +719,6 @@ static void uart_unthrottle(struct tty_s
+ struct uart_port *port;
+ upstat_t mask = 0;
+
+- if (!state)
+- return;
+-
+ port = uart_port_ref(state);
+ if (!port)
+ return;
+@@ -1707,6 +1701,16 @@ static void uart_dtr_rts(struct tty_port
+ uart_port_deref(uport);
+ }
+
++static int uart_install(struct tty_driver *driver, struct tty_struct *tty)
++{
++ struct uart_driver *drv = driver->driver_state;
++ struct uart_state *state = drv->state + tty->index;
++
++ tty->driver_data = state;
++
++ return tty_standard_install(driver, tty);
++}
++
+ /*
+ * Calls to uart_open are serialised by the tty_lock in
+ * drivers/tty/tty_io.c:tty_open()
+@@ -1719,11 +1723,8 @@ static void uart_dtr_rts(struct tty_port
+ */
+ static int uart_open(struct tty_struct *tty, struct file *filp)
+ {
+- struct uart_driver *drv = tty->driver->driver_state;
+- int retval, line = tty->index;
+- struct uart_state *state = drv->state + line;
+-
+- tty->driver_data = state;
++ struct uart_state *state = tty->driver_data;
++ int retval;
+
+ retval = tty_port_open(&state->port, tty, filp);
+ if (retval > 0)
+@@ -2421,6 +2422,7 @@ static void uart_poll_put_char(struct tt
+ #endif
+
+ static const struct tty_operations uart_ops = {
++ .install = uart_install,
+ .open = uart_open,
+ .close = uart_close,
+ .write = uart_write,
diff --git a/patches.suse/btrfs-do-not-allow-trimming-when-a-fs-is-mounted-wit.patch b/patches.suse/btrfs-do-not-allow-trimming-when-a-fs-is-mounted-wit.patch
new file mode 100644
index 0000000000..7d30e89d69
--- /dev/null
+++ b/patches.suse/btrfs-do-not-allow-trimming-when-a-fs-is-mounted-wit.patch
@@ -0,0 +1,55 @@
+From: Filipe Manana <fdmanana@suse.com>
+Date: Tue, 26 Mar 2019 10:49:56 +0000
+Git-commit: f35f06c35560a86e841631f0243b83a984dc11a9
+Patch-mainline: 5.1
+Subject: [PATCH] Btrfs: do not allow trimming when a fs is mounted with
+ the nologreplay option
+References: bsc#1135758
+
+Whan a filesystem is mounted with the nologreplay mount option, which
+requires it to be mounted in RO mode as well, we can not allow discard on
+free space inside block groups, because log trees refer to extents that
+are not pinned in a block group's free space cache (pinning the extents is
+precisely the first phase of replaying a log tree).
+
+So do not allow the fitrim ioctl to do anything when the filesystem is
+mounted with the nologreplay option, because later it can be mounted RW
+without that option, which causes log replay to happen and result in
+either a failure to replay the log trees (leading to a mount failure), a
+crash or some silent corruption.
+
+Reported-by: Darrick J. Wong <darrick.wong@oracle.com>
+Fixes: 96da09192cda ("btrfs: Introduce new mount option to disable tree log replay")
+CC: stable@vger.kernel.org # 4.9+
+Reviewed-by: Nikolay Borisov <nborisov@suse.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/ioctl.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
+index d0264f604588..5090594a8310 100644
+--- a/fs/btrfs/ioctl.c
++++ b/fs/btrfs/ioctl.c
+@@ -387,6 +387,16 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
++ /*
++ * If the fs is mounted with nologreplay, which requires it to be
++ * mounted in RO mode as well, we can not allow discard on free space
++ * inside block groups, because log trees refer to extents that are not
++ * pinned in a block group's free space cache (pinning the extents is
++ * precisely the first phase of replaying a log tree).
++ */
++ if (btrfs_test_opt(fs_info, NOLOGREPLAY))
++ return -EROFS;
++
+ rcu_read_lock();
+ list_for_each_entry_rcu(device, &fs_info->fs_devices->devices,
+ dev_list) {
+--
+2.19.0
+
diff --git a/patches.suse/btrfs-improve-performance-on-fsync-of-files-with-mul.patch b/patches.suse/btrfs-improve-performance-on-fsync-of-files-with-mul.patch
new file mode 100644
index 0000000000..9f8bac3ea2
--- /dev/null
+++ b/patches.suse/btrfs-improve-performance-on-fsync-of-files-with-mul.patch
@@ -0,0 +1,362 @@
+From: Filipe Manana <fdmanana@suse.com>
+Date: Wed, 17 Apr 2019 11:31:06 +0100
+Git-commit: b8aa330d2acb122563be87c42d82c5c8649cf658
+Patch-mainline: 5.2-rc1
+References: bsc#1123454
+Subject: [PATCH] Btrfs: improve performance on fsync of files with
+ multiple hardlinks
+
+Commit 41bd6067692382 ("Btrfs: fix fsync of files with multiple hard links
+in new directories") introduced a path that makes fsync fallback to a full
+transaction commit in order to avoid losing hard links and new ancestors
+of the fsynced inode. That path is triggered only when the inode has more
+than one hard link and either has a new hard link created in the current
+transaction or the inode was evicted and reloaded in the current
+transaction.
+
+That path ends up getting triggered very often (hundreds of times) during
+the course of pgbench benchmarks, resulting in performance drops of about
+20%.
+
+This change restores the performance by not triggering the full transaction
+commit in those cases, and instead iterate the fs/subvolume tree in search
+of all possible new ancestors, for all hard links, to log them.
+
+Reported-by: Zhao Yuhu <zyuhu@suse.com>
+Tested-by: James Wang <jnwang@suse.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/btrfs_inode.h | 6 --
+ fs/btrfs/inode.c | 17 ---
+ fs/btrfs/tree-log.c | 228 +++++++++++++++++++++++++++++++++--------
+ 3 files changed, 188 insertions(+), 63 deletions(-)
+
+diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
+index 7f895b673c4f..19e4eecd67ce 100644
+--- a/fs/btrfs/btrfs_inode.h
++++ b/fs/btrfs/btrfs_inode.h
+@@ -159,12 +159,6 @@ struct btrfs_inode {
+ */
+ u64 last_unlink_trans;
+
+- /*
+- * Track the transaction id of the last transaction used to create a
+- * hard link for the inode. This is used by the log tree (fsync).
+- */
+- u64 last_link_trans;
+-
+ /*
+ * Number of bytes outstanding that are going to need csums. This is
+ * used in ENOSPC accounting.
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
+index 0038dab54f40..b3e279e68eaa 100644
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -3668,21 +3668,6 @@ static int btrfs_read_locked_inode(struct inode *inode,
+ * inode is not a directory, logging its parent unnecessarily.
+ */
+ BTRFS_I(inode)->last_unlink_trans = BTRFS_I(inode)->last_trans;
+- /*
+- * Similar reasoning for last_link_trans, needs to be set otherwise
+- * for a case like the following:
+- *
+- * mkdir A
+- * touch foo
+- * ln foo A/bar
+- * echo 2 > /proc/sys/vm/drop_caches
+- * fsync foo
+- * <power failure>
+- *
+- * Would result in link bar and directory A not existing after the power
+- * failure.
+- */
+- BTRFS_I(inode)->last_link_trans = BTRFS_I(inode)->last_trans;
+
+ path->slots[0]++;
+ if (inode->i_nlink != 1 ||
+@@ -6494,7 +6479,6 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
+ if (err)
+ goto fail;
+ }
+- BTRFS_I(inode)->last_link_trans = trans->transid;
+ d_instantiate(dentry, inode);
+ ret = btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent,
+ true, NULL);
+@@ -9202,7 +9186,6 @@ struct inode *btrfs_alloc_inode(struct super_block *sb)
+ ei->index_cnt = (u64)-1;
+ ei->dir_index = 0;
+ ei->last_unlink_trans = 0;
+- ei->last_link_trans = 0;
+ ei->last_log_commit = 0;
+ ei->delayed_iput_count = 0;
+
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
+index 27c47acde982..5c0fd8b848ec 100644
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -6008,6 +6008,190 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans,
+ return ret;
+ }
+
++static int log_new_ancestors(struct btrfs_trans_handle *trans,
++ struct btrfs_root *root,
++ struct btrfs_path *path,
++ struct btrfs_log_ctx *ctx)
++{
++ struct btrfs_key found_key;
++
++ btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]);
++
++ while (true) {
++ struct btrfs_fs_info *fs_info = root->fs_info;
++ const u64 last_committed = fs_info->last_trans_committed;
++ struct extent_buffer *leaf = path->nodes[0];
++ int slot = path->slots[0];
++ struct btrfs_key search_key;
++ struct inode *inode;
++ int ret = 0;
++
++ btrfs_release_path(path);
++
++ search_key.objectid = found_key.offset;
++ search_key.type = BTRFS_INODE_ITEM_KEY;
++ search_key.offset = 0;
++ inode = btrfs_iget(fs_info->sb, &search_key, root, NULL);
++ if (IS_ERR(inode))
++ return PTR_ERR(inode);
++
++ if (BTRFS_I(inode)->generation > last_committed)
++ ret = btrfs_log_inode(trans, root, BTRFS_I(inode),
++ LOG_INODE_EXISTS,
++ 0, LLONG_MAX, ctx);
++ iput(inode);
++ if (ret)
++ return ret;
++
++ if (search_key.objectid == BTRFS_FIRST_FREE_OBJECTID)
++ break;
++
++ search_key.type = BTRFS_INODE_REF_KEY;
++ ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
++ if (ret < 0)
++ return ret;
++
++ leaf = path->nodes[0];
++ slot = path->slots[0];
++ if (slot >= btrfs_header_nritems(leaf)) {
++ ret = btrfs_next_leaf(root, path);
++ if (ret < 0)
++ return ret;
++ else if (ret > 0)
++ return -ENOENT;
++ leaf = path->nodes[0];
++ slot = path->slots[0];
++ }
++
++ btrfs_item_key_to_cpu(leaf, &found_key, slot);
++ if (found_key.objectid != search_key.objectid ||
++ found_key.type != BTRFS_INODE_REF_KEY)
++ return -ENOENT;
++ }
++ return 0;
++}
++
++static int log_new_ancestors_fast(struct btrfs_trans_handle *trans,
++ struct btrfs_inode *inode,
++ struct dentry *parent,
++ struct btrfs_log_ctx *ctx)
++{
++ struct btrfs_root *root = inode->root;
++ struct btrfs_fs_info *fs_info = root->fs_info;
++ struct dentry *old_parent = NULL;
++ struct super_block *sb = inode->vfs_inode.i_sb;
++ int ret = 0;
++
++ while (true) {
++ if (!parent || d_really_is_negative(parent) ||
++ sb != parent->d_sb)
++ break;
++
++ inode = BTRFS_I(d_inode(parent));
++ if (root != inode->root)
++ break;
++
++ if (inode->generation > fs_info->last_trans_committed) {
++ ret = btrfs_log_inode(trans, root, inode,
++ LOG_INODE_EXISTS, 0, LLONG_MAX, ctx);
++ if (ret)
++ break;
++ }
++ if (IS_ROOT(parent))
++ break;
++
++ parent = dget_parent(parent);
++ dput(old_parent);
++ old_parent = parent;
++ }
++ dput(old_parent);
++
++ return ret;
++}
++
++static int log_all_new_ancestors(struct btrfs_trans_handle *trans,
++ struct btrfs_inode *inode,
++ struct dentry *parent,
++ struct btrfs_log_ctx *ctx)
++{
++ struct btrfs_root *root = inode->root;
++ const u64 ino = btrfs_ino(inode);
++ struct btrfs_path *path;
++ struct btrfs_key search_key;
++ int ret;
++
++ /*
++ * For a single hard link case, go through a fast path that does not
++ * need to iterate the fs/subvolume tree.
++ */
++ if (inode->vfs_inode.i_nlink < 2)
++ return log_new_ancestors_fast(trans, inode, parent, ctx);
++
++ path = btrfs_alloc_path();
++ if (!path)
++ return -ENOMEM;
++
++ search_key.objectid = ino;
++ search_key.type = BTRFS_INODE_REF_KEY;
++ search_key.offset = 0;
++again:
++ ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
++ if (ret < 0)
++ goto out;
++ if (ret == 0)
++ path->slots[0]++;
++
++ while (true) {
++ struct extent_buffer *leaf = path->nodes[0];
++ int slot = path->slots[0];
++ struct btrfs_key found_key;
++
++ if (slot >= btrfs_header_nritems(leaf)) {
++ ret = btrfs_next_leaf(root, path);
++ if (ret < 0)
++ goto out;
++ else if (ret > 0)
++ break;
++ continue;
++ }
++
++ btrfs_item_key_to_cpu(leaf, &found_key, slot);
++ if (found_key.objectid != ino ||
++ found_key.type > BTRFS_INODE_EXTREF_KEY)
++ break;
++
++ /*
++ * Don't deal with extended references because they are rare
++ * cases and too complex to deal with (we would need to keep
++ * track of which subitem we are processing for each item in
++ * this loop, etc). So just return some error to fallback to
++ * a transaction commit.
++ */
++ if (found_key.type == BTRFS_INODE_EXTREF_KEY) {
++ ret = -EMLINK;
++ goto out;
++ }
++
++ /*
++ * Logging ancestors needs to do more searches on the fs/subvol
++ * tree, so it releases the path as needed to avoid deadlocks.
++ * Keep track of the last inode ref key and resume from that key
++ * after logging all new ancestors for the current hard link.
++ */
++ memcpy(&search_key, &found_key, sizeof(search_key));
++
++ ret = log_new_ancestors(trans, root, path, ctx);
++ if (ret)
++ goto out;
++ btrfs_release_path(path);
++ goto again;
++ }
++ ret = 0;
++out:
++ btrfs_free_path(path);
++ return ret;
++}
++
+ /*
+ * helper function around btrfs_log_inode to make sure newly created
+ * parent directories also end up in the log. A minimal inode and backref
+@@ -6026,11 +6210,9 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
+ struct btrfs_fs_info *fs_info = root->fs_info;
+ int inode_only = exists_only ? LOG_INODE_EXISTS : LOG_INODE_ALL;
+ struct super_block *sb;
+- struct dentry *old_parent = NULL;
+ int ret = 0;
+ u64 last_committed = fs_info->last_trans_committed;
+ bool log_dentries = false;
+- struct btrfs_inode *orig_inode = inode;
+
+ sb = inode->vfs_inode.i_sb;
+
+@@ -6136,54 +6318,20 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
+ * and has a link count of 2.
+ */
+ if (inode->last_unlink_trans > last_committed) {
+- ret = btrfs_log_all_parents(trans, orig_inode, ctx);
++ ret = btrfs_log_all_parents(trans, inode, ctx);
+ if (ret)
+ goto end_trans;
+ }
+
+- /*
+- * If a new hard link was added to the inode in the current transaction
+- * and its link count is now greater than 1, we need to fallback to a
+- * transaction commit, otherwise we can end up not logging all its new
+- * parents for all the hard links. Here just from the dentry used to
+- * fsync, we can not visit the ancestor inodes for all the other hard
+- * links to figure out if any is new, so we fallback to a transaction
+- * commit (instead of adding a lot of complexity of scanning a btree,
+- * since this scenario is not a common use case).
+- */
+- if (inode->vfs_inode.i_nlink > 1 &&
+- inode->last_link_trans > last_committed) {
+- ret = -EMLINK;
++ ret = log_all_new_ancestors(trans, inode, parent, ctx);
++ if (ret)
+ goto end_trans;
+- }
+-
+- while (1) {
+- if (!parent || d_really_is_negative(parent) || sb != parent->d_sb)
+- break;
+-
+- inode = BTRFS_I(d_inode(parent));
+- if (root != inode->root)
+- break;
+
+- if (inode->generation > last_committed) {
+- ret = btrfs_log_inode(trans, root, inode,
+- LOG_INODE_EXISTS, 0, LLONG_MAX, ctx);
+- if (ret)
+- goto end_trans;
+- }
+- if (IS_ROOT(parent))
+- break;
+-
+- parent = dget_parent(parent);
+- dput(old_parent);
+- old_parent = parent;
+- }
+ if (log_dentries)
+- ret = log_new_dir_dentries(trans, root, orig_inode, ctx);
++ ret = log_new_dir_dentries(trans, root, inode, ctx);
+ else
+ ret = 0;
+ end_trans:
+- dput(old_parent);
+ if (ret < 0) {
+ btrfs_set_log_full_commit(fs_info, trans);
+ ret = 1;
+--
+2.19.0
+
diff --git a/patches.suse/btrfs-send-flush-dellaloc-in-order-to-avoid-data-los.patch b/patches.suse/btrfs-send-flush-dellaloc-in-order-to-avoid-data-los.patch
new file mode 100644
index 0000000000..08bae44eec
--- /dev/null
+++ b/patches.suse/btrfs-send-flush-dellaloc-in-order-to-avoid-data-los.patch
@@ -0,0 +1,136 @@
+From: Filipe Manana <fdmanana@suse.com>
+Date: Mon, 15 Apr 2019 09:29:36 +0100
+Git-commit: 9f89d5de8631c7930898a601b6612e271aa2261c
+Patch-mainline: 5.2-rc1
+References: bsc#1133320
+Subject: [PATCH] Btrfs: send, flush dellaloc in order to avoid data loss
+
+When we set a subvolume to read-only mode we do not flush dellaloc for any
+of its inodes (except if the filesystem is mounted with -o flushoncommit),
+since it does not affect correctness for any subsequent operations - except
+for a future send operation. The send operation will not be able to see the
+delalloc data since the respective file extent items, inode item updates,
+backreferences, etc, have not hit yet the subvolume and extent trees.
+
+Effectively this means data loss, since the send stream will not contain
+any data from existing delalloc. Another problem from this is that if the
+writeback starts and finishes while the send operation is in progress, we
+have the subvolume tree being being modified concurrently which can result
+in send failing unexpectedly with EIO or hitting runtime errors, assertion
+failures or hitting BUG_ONs, etc.
+
+Simple reproducer:
+
+ $ mkfs.btrfs -f /dev/sdb
+ $ mount /dev/sdb /mnt
+
+ $ btrfs subvolume create /mnt/sv
+ $ xfs_io -f -c "pwrite -S 0xea 0 108K" /mnt/sv/foo
+
+ $ btrfs property set /mnt/sv ro true
+ $ btrfs send -f /tmp/send.stream /mnt/sv
+
+ $ od -t x1 -A d /mnt/sv/foo
+ 0000000 ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea ea
+ *
+ 0110592
+
+ $ umount /mnt
+ $ mkfs.btrfs -f /dev/sdc
+ $ mount /dev/sdc /mnt
+
+ $ btrfs receive -f /tmp/send.stream /mnt
+ $ echo $?
+ 0
+ $ od -t x1 -A d /mnt/sv/foo
+ 0000000
+ # ---> empty file
+
+Since this a problem that affects send only, fix it in send by flushing
+dellaloc for all the roots used by the send operation before send starts
+to process the commit roots.
+
+This is a problem that affects send since it was introduced (commit
+31db9f7c23fbf7 ("Btrfs: introduce BTRFS_IOC_SEND for btrfs send/receive"))
+but backporting it to older kernels has some dependencies:
+
+- For kernels between 3.19 and 4.20, it depends on commit 3cd24c698004d2
+ ("btrfs: use tagged writepage to mitigate livelock of snapshot") because
+ the function btrfs_start_delalloc_snapshot() does not exist before that
+ commit. So one has to either pick that commit or replace the calls to
+ btrfs_start_delalloc_snapshot() in this patch with calls to
+ btrfs_start_delalloc_inodes().
+
+- For kernels older than 3.19 it also requires commit e5fa8f865b3324
+ ("Btrfs: ensure send always works on roots without orphans") because
+ it depends on the function ensure_commit_roots_uptodate() which that
+ commits introduced.
+
+- No dependencies for 5.0+ kernels.
+
+A test case for fstests follows soon.
+
+CC: stable@vger.kernel.org # 3.19+
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/send.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
+index b1eba0274983..0cfad0b15c4e 100644
+--- a/fs/btrfs/send.c
++++ b/fs/btrfs/send.c
+@@ -6574,6 +6574,38 @@ static int ensure_commit_roots_uptodate(struct send_ctx *sctx)
+ return btrfs_commit_transaction(trans);
+ }
+
++/*
++ * Make sure any existing dellaloc is flushed for any root used by a send
++ * operation so that we do not miss any data and we do not race with writeback
++ * finishing and changing a tree while send is using the tree. This could
++ * happen if a subvolume is in RW mode, has delalloc, is turned to RO mode and
++ * a send operation then uses the subvolume.
++ * After flushing delalloc ensure_commit_roots_uptodate() must be called.
++ */
++static int flush_delalloc_roots(struct send_ctx *sctx)
++{
++ struct btrfs_root *root = sctx->parent_root;
++ int ret;
++ int i;
++
++ if (root) {
++ ret = btrfs_start_delalloc_inodes(root, 0);
++ if (ret)
++ return ret;
++ btrfs_wait_ordered_extents(root, -1, 0, U64_MAX);
++ }
++
++ for (i = 0; i < sctx->clone_roots_cnt; i++) {
++ root = sctx->clone_roots[i].root;
++ ret = btrfs_start_delalloc_inodes(root, 0);
++ if (ret)
++ return ret;
++ btrfs_wait_ordered_extents(root, -1, 0, U64_MAX);
++ }
++
++ return 0;
++}
++
+ static void btrfs_root_dec_send_in_progress(struct btrfs_root* root)
+ {
+ spin_lock(&root->root_item_lock);
+@@ -6809,6 +6841,10 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
+ NULL);
+ sort_clone_roots = 1;
+
++ ret = flush_delalloc_roots(sctx);
++ if (ret)
++ goto out;
++
+ ret = ensure_commit_roots_uptodate(sctx);
+ if (ret)
+ goto out;
+--
+2.19.0
+
diff --git a/series.conf b/series.conf
index baae52c2ed..e316b8f077 100644
--- a/series.conf
+++ b/series.conf
@@ -21761,6 +21761,7 @@
patches.drivers/Bluetooth-btusb-request-wake-pin-with-NOAUTOEN.patch
patches.fixes/virtio_pci-fix-a-NULL-pointer-reference-in-vp_del_vq.patch
patches.fixes/virtio-Honour-may_reduce_num-in-vring_create_virtque.patch
+ patches.suse/btrfs-do-not-allow-trimming-when-a-fs-is-mounted-wit.patch
patches.drm/0001-drm-udl-add-a-release-method-and-delay-modeset-teard.patch
patches.drm/0003-drm-mediatek-Fix-an-error-code-in-mtk_hdmi_dt_parse_.patch
patches.drm/drm-mediatek-fix-possible-object-reference-leak.patch
@@ -21903,6 +21904,8 @@
patches.suse/0007-btrfs-extent-tree-Use-btrfs_ref-to-refactor-btrfs_in.patch
patches.suse/0008-btrfs-extent-tree-Use-btrfs_ref-to-refactor-btrfs_fr.patch
patches.suse/0009-btrfs-qgroup-Don-t-scan-leaf-if-we-re-modifying-relo.patch
+ patches.suse/btrfs-send-flush-dellaloc-in-order-to-avoid-data-los.patch
+ patches.suse/btrfs-improve-performance-on-fsync-of-files-with-mul.patch
patches.drivers/mmc-core-fix-possible-use-after-free-of-host.patch
patches.drivers/phy-sun4i-usb-Make-sure-to-disable-PHY0-passby-for-p.patch
patches.drivers/stm-class-Fix-channel-free-in-stm-output-free-path.patch
@@ -21944,6 +21947,7 @@
patches.drivers/tty-vt.c-Fix-TIOCL_BLANKSCREEN-console-blanking-if-b.patch
patches.drivers/tty-pty-Fix-race-condition-between-release_one_tty-a.patch
patches.drivers/Revert-tty-pty-Fix-race-condition-between-release_on.patch
+ patches.suse/TTY-serial_core-add-install.patch
patches.drivers/ipmi-ssif-compare-block-number-correctly-for-multi-p.patch
patches.drivers/media-ivtv-update-pos-correctly-in-ivtv_read_pos.patch
patches.drivers/media-cx18-update-pos-correctly-in-cx18_read_pos.patch
@@ -22057,6 +22061,8 @@
patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch
patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch
patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch
+ patches.drivers/soc-fsl-qe-Fix-an-error-code-in-qe_pin_request.patch
+ patches.fixes/vsock-virtio-Initialize-core-virtio-vsock-before-reg.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch