]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
6 years agoRevert "x86/enter: Use IBRS on syscall and interrupts"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:20 +0000 (15:38 +0000)]
Revert "x86/enter: Use IBRS on syscall and interrupts"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit d7eb5f9ed26dbdc39df793491bdcc9f80d41325e.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/idle: Disable IBRS entering idle and enable it on wakeup"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:20 +0000 (15:38 +0000)]
Revert "x86/idle: Disable IBRS entering idle and enable it on wakeup"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 5521b04afda1d683c1ebad6c25c2529a88e6f061.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/idle: Disable IBRS when offlining cpu and re-enable on wakeup"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:19 +0000 (15:38 +0000)]
Revert "x86/idle: Disable IBRS when offlining cpu and re-enable on wakeup"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 9bcf662c1690880b2464fe99d0f58dce53c0d89f.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/mm: Set IBPB upon context switch"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:18 +0000 (15:38 +0000)]
Revert "x86/mm: Set IBPB upon context switch"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit a3320203792b633fb96df5d0bbfb7036129b78e2.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/mm: Only set IBPB when the new thread cannot ptrace current thread"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:17 +0000 (15:38 +0000)]
Revert "x86/mm: Only set IBPB when the new thread cannot ptrace current thread"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 65941af723059ffeeca269b99ab51b3c9e320751.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/entry: Stuff RSB for entry to kernel for non-SMEP platform"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:16 +0000 (15:38 +0000)]
Revert "x86/entry: Stuff RSB for entry to kernel for non-SMEP platform"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit b82785ac1d33ce219c77d72b7bd80a21e1441ac8.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/kvm: add MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD to kvm"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:15 +0000 (15:38 +0000)]
Revert "x86/kvm: add MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD to kvm"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 15eb187f47ee2be44d34313bc89cfb719d82cb21.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/kvm: Set IBPB when switching VM"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:14 +0000 (15:38 +0000)]
Revert "x86/kvm: Set IBPB when switching VM"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 665076ad780e8620505c742cfcb4b0f3fb99324a.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/kvm: Toggle IBRS on VM entry and exit"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:13 +0000 (15:38 +0000)]
Revert "x86/kvm: Toggle IBRS on VM entry and exit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 3dc28210342f174270bcefac74ef5d0b52ffd846.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/kvm: Pad RSB on VM transition"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:12 +0000 (15:38 +0000)]
Revert "x86/kvm: Pad RSB on VM transition"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 5369368d3520addb2ffb2413cfa7e8f3efe2e31d.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:11 +0000 (15:38 +0000)]
Revert "x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 23225db7b02c7f8b94e5d5050987430089e6f7cc.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/spec_ctrl: Add lock to serialize changes to ibrs and ibpb control"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:10 +0000 (15:38 +0000)]
Revert "x86/spec_ctrl: Add lock to serialize changes to ibrs and ibpb control"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 85789933bc45a3e763823675bd0d80e3e617f234.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/syscall: Clear unused extra registers on syscall entrance"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:09 +0000 (15:38 +0000)]
Revert "x86/syscall: Clear unused extra registers on syscall entrance"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 7b5ea16f42b5e4860cf9033897bcdfa3e1209033.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/syscall: Clear unused extra registers on 32-bit compatible syscall entrance"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:08 +0000 (15:38 +0000)]
Revert "x86/syscall: Clear unused extra registers on 32-bit compatible syscall entrance"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 725ad2ef81ccceb3e31a7263faae2059d05e2c48.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/entry: Use retpoline for syscall's indirect calls"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:06 +0000 (15:38 +0000)]
Revert "x86/entry: Use retpoline for syscall's indirect calls"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit d2e0236f395e876f5303fb5021e4fe6eea881402.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/cpu/AMD: Add speculative control support for AMD"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:05 +0000 (15:38 +0000)]
Revert "x86/cpu/AMD: Add speculative control support for AMD"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 8c3fc9e98177daee2281ed40e3d61f9cf4eee576.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/microcode: Extend post microcode reload to support IBPB feature"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:04 +0000 (15:38 +0000)]
Revert "x86/microcode: Extend post microcode reload to support IBPB feature"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 099878acd3738271fb2ade01f4649b1ed2fb72d5.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "KVM: SVM: Do not intercept new speculative control MSRs"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:03 +0000 (15:38 +0000)]
Revert "KVM: SVM: Do not intercept new speculative control MSRs"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit ccaa77a824fd3e21f0b8ae6b5a66fc1ee7e35b14.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/svm: Set IBRS value on VM entry and exit"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:02 +0000 (15:38 +0000)]
Revert "x86/svm: Set IBRS value on VM entry and exit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 72f71e6826fac9a656c3994fb6f979cd65a14c64.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/svm: Set IBPB when running a different VCPU"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:01 +0000 (15:38 +0000)]
Revert "x86/svm: Set IBPB when running a different VCPU"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 0ba3eaabbb6666ebd344ee80534e58c375a00810.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "KVM: x86: Add speculative control CPUID support for guests"
Andy Whitcroft [Wed, 31 Jan 2018 15:38:00 +0000 (15:38 +0000)]
Revert "KVM: x86: Add speculative control CPUID support for guests"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit db7641e5f41cd517c4181ce90c4f9ecc93af4b2b.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/svm: Add code to clobber the RSB on VM exit"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:59 +0000 (15:37 +0000)]
Revert "x86/svm: Add code to clobber the RSB on VM exit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 9392e24469b71ff665cdbc3d81db215f9383219d.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/svm: Add code to clear registers on VM exit"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:58 +0000 (15:37 +0000)]
Revert "x86/svm: Add code to clear registers on VM exit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 95177e2c17c2cba93d431e18c7c563cc00b303e6.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/cpu/AMD: Remove now unused definition of MFENCE_RDTSC feature"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:57 +0000 (15:37 +0000)]
Revert "x86/cpu/AMD: Remove now unused definition of MFENCE_RDTSC feature"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 6e6c998937329e9d13d4b239233cd058e8a7730f.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "powerpc: add gmb barrier"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:56 +0000 (15:37 +0000)]
Revert "powerpc: add gmb barrier"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 761a289f88a1ef73f1b8332a2f61bcee8da89e0e.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "s390/spinlock: add gmb memory barrier"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:55 +0000 (15:37 +0000)]
Revert "s390/spinlock: add gmb memory barrier"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 74d11fe3e7d95384d51521d312a262cfcf81f791.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: x86/kvm: Fix stuff_RSB() for 32-bit"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:54 +0000 (15:37 +0000)]
Revert "UBUNTU: SAUCE: x86/kvm: Fix stuff_RSB() for 32-bit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 306dada4f850bf537dbd8ff06cf1522074b3f327.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: x86/microcode: Extend post microcode reload to support IBPB...
Andy Whitcroft [Wed, 31 Jan 2018 15:37:53 +0000 (15:37 +0000)]
Revert "UBUNTU: SAUCE: x86/microcode: Extend post microcode reload to support IBPB feature -- repair missmerge"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit bdd2ad0f96a8dfd851f893fb3afb5907ca07e240.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "Revert "x86/svm: Add code to clear registers on VM exit""
Andy Whitcroft [Wed, 31 Jan 2018 15:37:52 +0000 (15:37 +0000)]
Revert "Revert "x86/svm: Add code to clear registers on VM exit""

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit c891a91cada9e22e483f6d84e130a9bfa5804e3d.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "kvm: vmx: Scrub hardware GPRs at VM-exit"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:52 +0000 (15:37 +0000)]
Revert "kvm: vmx: Scrub hardware GPRs at VM-exit"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit f316e939d22fc49c28265d2cb14e75682ddd1410.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "UBUNTU: SAUCE: x86/entry: Fix up retpoline assembler labels"
Andy Whitcroft [Wed, 31 Jan 2018 15:37:51 +0000 (15:37 +0000)]
Revert "UBUNTU: SAUCE: x86/entry: Fix up retpoline assembler labels"

CVE-2017-5753 (revert embargoed)
CVE-2017-5715 (revert embargoed)

This reverts commit 57ed6ed2b6284c10b8d2e0072c680d0e6adac2dc.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agox86/mm: Fix overlap of i386 CPU_ENTRY_AREA with FIX_BTMAP
William Grant [Tue, 30 Jan 2018 11:22:55 +0000 (22:22 +1100)]
x86/mm: Fix overlap of i386 CPU_ENTRY_AREA with FIX_BTMAP

BugLink: http://bugs.launchpad.net/bugs/1745118
Since commit 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the
fixmap"), i386's CPU_ENTRY_AREA has been mapped to the memory area just
below FIXADDR_START. But already immediately before FIXADDR_START is the
FIX_BTMAP area, which means that early_ioremap can collide with the entry
area.

It's especially bad on PAE where FIX_BTMAP_BEGIN gets aligned to exactly
match CPU_ENTRY_AREA_BASE, so the first early_ioremap slot clobbers the
IDT and causes interrupts during early boot to reset the system.

The overlap wasn't a problem before the CPU entry area was introduced,
as the fixmap has classically been preceded by the pkmap or vmalloc
areas, neither of which is used until early_ioremap is out of the
picture.

Relocate CPU_ENTRY_AREA to below FIX_BTMAP, not just below the permanent
fixmap area.

Fixes: commit 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
Signed-off-by: William Grant <william.grant@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/7041d181-a019-e8b9-4e4e-48215f841e2c@canonical.com
(cherry picked from commit 55f49fcb879fbeebf2a8c1ac7c9e6d90df55f798 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoip_gre: remove the incorrect mtu limit for ipgre tap
Xin Long [Fri, 19 Jan 2018 15:54:00 +0000 (16:54 +0100)]
ip_gre: remove the incorrect mtu limit for ipgre tap

BugLink: http://bugs.launchpad.net/bugs/1743746
ipgre tap driver calls ether_setup(), after commit 61e84623ace3
("net: centralize net_device min/max MTU checking"), the range
of mtu is [min_mtu, max_mtu], which is [68, 1500] by default.

It causes the dev mtu of the ipgre tap device to not be greater
than 1500, this limit value is not correct for ipgre tap device.

Besides, it's .change_mtu already does the right check. So this
patch is just to set max_mtu as 0, and leave the check to it's
.change_mtu.

Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cfddd4c33c254954927942599d299b3865743146)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agonet: ipv4: fix for a race condition in raw_sendmsg
Mohamed Ghannam [Sun, 10 Dec 2017 03:50:58 +0000 (03:50 +0000)]
net: ipv4: fix for a race condition in raw_sendmsg

inet->hdrincl is racy, and could lead to uninitialized stack pointer
usage, so its value should be read only once.

Fixes: c008ba5bdc9f ("ipv4: Avoid reading user iov twice after raw_probe_proto_opt")
Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
CVE-2017-17712
(cherry picked from commit 8f659a03a0ba9289b9aeb9b4470e6fb263d6f483)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: [Packaging] update urgency to medium by default
Andy Whitcroft [Thu, 25 Jan 2018 10:27:00 +0000 (11:27 +0100)]
UBUNTU: [Packaging] update urgency to medium by default

BugLink: http://bugs.launchpad.net/bugs/1745338
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agosctp: do not peel off an assoc from one netns to another one
Xin Long [Thu, 7 Dec 2017 15:07:00 +0000 (16:07 +0100)]
sctp: do not peel off an assoc from one netns to another one

Now when peeling off an association to the sock in another netns, all
transports in this assoc are not to be rehashed and keep use the old
key in hashtable.

As a transport uses sk->net as the hash key to insert into hashtable,
it would miss removing these transports from hashtable due to the new
netns when closing the sock and all transports are being freeed, then
later an use-after-free issue could be caused when looking up an asoc
and dereferencing those transports.

This is a very old issue since very beginning, ChunYu found it with
syzkaller fuzz testing with this series:

  socket$inet6_sctp()
  bind$inet6()
  sendto$inet6()
  unshare(0x40000000)
  getsockopt$inet_sctp6_SCTP_GET_ASSOC_ID_LIST()
  getsockopt$inet_sctp6_SCTP_SOCKOPT_PEELOFF()

This patch is to block this call when peeling one assoc off from one
netns to another one, so that the netns of all transport would not
go out-sync with the key in hashtable.

Note that this patch didn't fix it by rehashing transports, as it's
difficult to handle the situation when the tuple is already in use
in the new netns. Besides, no one would like to peel off one assoc
to another netns, considering ipaddrs, ifaces, etc. are usually
different.

Reported-by: ChunYu Wang <chunwang@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
CVE-2017-15115
(cherry picked from commit df80cd9b28b9ebaa284a41df611dbf3a2d05ca74)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agodccp: CVE-2017-8824: use-after-free in DCCP code
Mohamed Ghannam [Fri, 8 Dec 2017 14:39:50 +0000 (15:39 +0100)]
dccp: CVE-2017-8824: use-after-free in DCCP code

Whenever the sock object is in DCCP_CLOSED state,
dccp_disconnect() must free dccps_hc_tx_ccid and
dccps_hc_rx_ccid and set to NULL.

Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
CVE-2017-8824
(cherry picked from commit 69c64866ce072dea1d1e59a0d61e0f66c0dffb76 linux-next)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: Start new release
Stefan Bader [Fri, 26 Jan 2018 07:49:45 +0000 (08:49 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-32.35 Ubuntu-4.13.0-32.35
Stefan Bader [Thu, 25 Jan 2018 08:37:03 +0000 (09:37 +0100)]
UBUNTU: Ubuntu-4.13.0-32.35

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
6 years agoUBUNTU: SAUCE: x86/entry: Fix up retpoline assembler labels
Jay Vosburgh [Thu, 25 Jan 2018 05:43:56 +0000 (21:43 -0800)]
UBUNTU: SAUCE: x86/entry: Fix up retpoline assembler labels

The extant assembler labels in entry_SYSCALL_64_fastpath
result in the error path incorrectly entering the retpoline logic.
This results in that logic jumping to whatever address is in %r10,
which is the fourth system call argument.

This enables a trivial means to instruct the kernel to jump
to any arbitrary address.  Non-malicious executables making invalid
system calls may also cause the system to crash.

Resolve this by renumbering the assembler labels as is found
in other kernels.

CVE-2017-5753
CVE-2017-5715

Fixes: d2e0236 ("x86/entry: Use retpoline for syscall's indirect calls")
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
6 years agoUBUNTU: Start new release
Stefan Bader [Tue, 23 Jan 2018 08:13:39 +0000 (09:13 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-31.34 Ubuntu-4.13.0-31.34
Marcelo Henrique Cerri [Fri, 19 Jan 2018 12:16:44 +0000 (10:16 -0200)]
UBUNTU: Ubuntu-4.13.0-31.34

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: [Config] KERNEL_NOBP=y
Marcelo Henrique Cerri [Thu, 18 Jan 2018 16:12:55 +0000 (14:12 -0200)]
UBUNTU: [Config] KERNEL_NOBP=y

CVE-2017-5753
CVE-2017-5715

Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: SAUCE: s390: print messages for gmb and nobp
Marcelo Henrique Cerri [Thu, 18 Jan 2018 16:12:54 +0000 (14:12 -0200)]
UBUNTU: SAUCE: s390: print messages for gmb and nobp

CVE-2017-5753
CVE-2017-5715

Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: SAUCE: s390: improve cpu alternative handling for gmb and nobp
Martin Schwidefsky [Thu, 18 Jan 2018 16:12:53 +0000 (14:12 -0200)]
UBUNTU: SAUCE: s390: improve cpu alternative handling for gmb and nobp

CVE-2017-5753
CVE-2017-5715

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: Start new release
Stefan Bader [Thu, 18 Jan 2018 14:39:39 +0000 (15:39 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-30.33 Ubuntu-4.13.0-30.33
Marcelo Henrique Cerri [Mon, 15 Jan 2018 18:50:32 +0000 (16:50 -0200)]
UBUNTU: Ubuntu-4.13.0-30.33

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: [Packaging] git-ubuntu-log -- handle multiple bugs/cves better
Andy Whitcroft [Mon, 15 Jan 2018 13:26:19 +0000 (13:26 +0000)]
UBUNTU: [Packaging] git-ubuntu-log -- handle multiple bugs/cves better

BugLink: http://bugs.launchpad.net/bugs/1743383
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoRevert "scsi: libsas: allow async aborts"
Marcelo Henrique Cerri [Mon, 15 Jan 2018 17:52:34 +0000 (15:52 -0200)]
Revert "scsi: libsas: allow async aborts"

BugLink: http://bugs.launchpad.net/bugs/1726519
This reverts commit 909657615d9b3ce709be4fd95b9a9e8c8c7c2be6.

Acked-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agokvm: vmx: Scrub hardware GPRs at VM-exit
Jim Mattson [Wed, 3 Jan 2018 22:31:38 +0000 (14:31 -0800)]
kvm: vmx: Scrub hardware GPRs at VM-exit

CVE-2017-5753
CVE-2017-5715

commit 0cb5b30698fdc8f6b4646012e3acb4ddce430788 upstream.

Guest GPR values are live in the hardware GPRs at VM-exit.  Do not
leave any guest values in hardware GPRs after the guest GPR values are
saved to the vcpu_vmx structure.

This is a partial mitigation for CVE 2017-5715 and CVE 2017-5753.
Specifically, it defeats the Project Zero PoC for CVE 2017-5715.

Suggested-by: Eric Northup <digitaleric@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Eric Northup <digitaleric@google.com>
Reviewed-by: Benjamin Serebrin <serebrin@google.com>
Reviewed-by: Andrew Honig <ahonig@google.com>
[Paolo: Add AMD bits, Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoRevert "x86/svm: Add code to clear registers on VM exit"
Andy Whitcroft [Mon, 15 Jan 2018 11:38:44 +0000 (11:38 +0000)]
Revert "x86/svm: Add code to clear registers on VM exit"

CVE-2017-5753
CVE-2017-5715

This reverts commit 95177e2c17c2cba93d431e18c7c563cc00b303e6.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
6 years agoUBUNTU: SAUCE: x86/microcode: Extend post microcode reload to support IBPB feature...
Andy Whitcroft [Mon, 15 Jan 2018 09:21:17 +0000 (09:21 +0000)]
UBUNTU: SAUCE: x86/microcode: Extend post microcode reload to support IBPB feature -- repair missmerge

CVE-2017-5753
CVE-2017-5715

Fix missmerge leading to removal of late_initcall().

Signed-off-by: Andy Whitcroft <apw@canonical.com>
6 years agoUBUNTU: Start new release
Marcelo Henrique Cerri [Mon, 15 Jan 2018 18:00:09 +0000 (16:00 -0200)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-29.32 Ubuntu-4.13.0-29.32
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 11:13:58 +0000 (12:13 +0100)]
UBUNTU: Ubuntu-4.13.0-29.32

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "UBUNTU: [Config] updateconfigs to enable GENERIC_CPU_VULNERABILITIES"
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 11:07:31 +0000 (12:07 +0100)]
Revert "UBUNTU: [Config] updateconfigs to enable GENERIC_CPU_VULNERABILITIES"

CVE-2017-5754

This reverts commit 569df03939310feb1763c76cb94200b0338d7682.

CONFIG_GENERIC_CPU_VULNERABILITIES is not needed anymore after reverting
the sysfs cpu vulnerabilites patches.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "sysfs/cpu: Add vulnerability folder"
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 10:53:30 +0000 (11:53 +0100)]
Revert "sysfs/cpu: Add vulnerability folder"

CVE-2017-5754

This reverts commit 3aae516fba5eb821948a8ce19d8e38076d070b8f.

The vulnerability sysfs entries have been reverted, so the documentation
and sysfs directory needs to be reverted as well.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "sysfs/cpu: Fix typos in vulnerability documentation"
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 10:51:08 +0000 (11:51 +0100)]
Revert "sysfs/cpu: Fix typos in vulnerability documentation"

CVE-2017-5754

This reverts commit 45e5402e8f1ae636a95247f09e2a6052fe7e1c43.

The vulnerability sysfs entries have been reverted, so the documentation
and sysfs directory needs to be reverted as well.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoRevert "x86/cpu: Implement CPU vulnerabilites sysfs functions"
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 10:36:01 +0000 (11:36 +0100)]
Revert "x86/cpu: Implement CPU vulnerabilites sysfs functions"

CVE-2017-5754

This reverts commit 7e4c83e48151935197387bc98ac893c590b25b6d.

The upstream commits are not ready yet to display mitigation status for
spectre_v1 and spectre_v2, so revert this commit to avoid confusion.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: Start new release
Kleber Sacilotto de Souza [Fri, 12 Jan 2018 11:02:57 +0000 (12:02 +0100)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-28.31 Ubuntu-4.13.0-28.31
Seth Forshee [Thu, 11 Jan 2018 23:48:34 +0000 (17:48 -0600)]
UBUNTU: Ubuntu-4.13.0-28.31

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: x86/kvm: Fix stuff_RSB() for 32-bit
William Grant [Thu, 11 Jan 2018 23:05:42 +0000 (17:05 -0600)]
UBUNTU: SAUCE: x86/kvm: Fix stuff_RSB() for 32-bit

CVE-2017-5753
CVE-2017-5715

Signed-off-by: William Grant <wgrant@ubuntu.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: Start new release
Seth Forshee [Thu, 11 Jan 2018 23:43:58 +0000 (17:43 -0600)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: Ubuntu-4.13.0-27.30 Ubuntu-4.13.0-27.30
Marcelo Henrique Cerri [Thu, 11 Jan 2018 20:42:34 +0000 (18:42 -0200)]
UBUNTU: Ubuntu-4.13.0-27.30

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agox86/microcode/AMD: Add support for fam17h microcode loading
Tom Lendacky [Thu, 30 Nov 2017 22:46:40 +0000 (16:46 -0600)]
x86/microcode/AMD: Add support for fam17h microcode loading

CVE-2017-5753
CVE-2017-5715

The size for the Microcode Patch Block (MPB) for an AMD family 17h
processor is 3200 bytes.  Add a #define for fam17h so that it does
not default to 2048 bytes and fail a microcode load/update.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@alien8.de>
Link: https://lkml.kernel.org/r/20171130224640.15391.40247.stgit@tlendack-t1.amdoffice.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit f4e9b7af0cd58dd039a0fb2cd67d57cea4889abf)
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
6 years agoUBUNTU: [Config] updateconfigs to enable GENERIC_CPU_VULNERABILITIES
Kleber Sacilotto de Souza [Thu, 11 Jan 2018 19:14:31 +0000 (20:14 +0100)]
UBUNTU: [Config] updateconfigs to enable GENERIC_CPU_VULNERABILITIES

The new kernel config option was added by commit "sysfs/cpu: Add
vulnerability folder".

CVE-2017-5754
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: [Config] Disable CONFIG_PPC_DEBUG_RFI
Marcelo Henrique Cerri [Wed, 10 Jan 2018 20:17:08 +0000 (18:17 -0200)]
UBUNTU: [Config] Disable CONFIG_PPC_DEBUG_RFI

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Make the fallback robust against memory corruption
Michael Ellerman [Tue, 9 Jan 2018 15:43:00 +0000 (21:13 +0530)]
UBUNTU: SAUCE: rfi-flush: Make the fallback robust against memory corruption

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
The load dependency we add in the fallback flush relies on the value
we loaded from the fallback area being zero. Although that should
always be the case, bugs happen, so make the code robust against any
corruption by xor'ing it with itself.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Fix some RFI conversions in the KVM code
Michael Ellerman [Mon, 8 Jan 2018 06:39:52 +0000 (12:09 +0530)]
UBUNTU: SAUCE: rfi-flush: Fix some RFI conversions in the KVM code

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Spotted by Paul.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Fix the 32-bit KVM build
Michael Ellerman [Mon, 8 Jan 2018 06:39:45 +0000 (12:09 +0530)]
UBUNTU: SAUCE: rfi-flush: Fix the 32-bit KVM build

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Spotted by Paul.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Fallback flush add load dependency
Nicholas Piggin [Mon, 8 Jan 2018 06:39:37 +0000 (12:09 +0530)]
UBUNTU: SAUCE: rfi-flush: Fallback flush add load dependency

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Add a data dependency on loads for the fallback flush. This
reduces or eliminates instances of incomplete flushing on P8 and
P9.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Use rfi-flush in printks
Michael Ellerman [Sun, 7 Jan 2018 13:07:03 +0000 (00:07 +1100)]
UBUNTU: SAUCE: rfi-flush: Use rfi-flush in printks

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Add no_rfi_flush and nopti comandline options
Michael Ellerman [Sun, 7 Jan 2018 12:52:42 +0000 (23:52 +1100)]
UBUNTU: SAUCE: rfi-flush: Add no_rfi_flush and nopti comandline options

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
We use the x86 'nopti' option because all the documenation on earth is
going to refer to that, and we can guess what users mean when they
specify that - they want to avoid any overhead due to Meltdown
mitigations.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Refactor the macros so the nops are defined once
Michael Ellerman [Sun, 7 Jan 2018 11:02:02 +0000 (22:02 +1100)]
UBUNTU: SAUCE: rfi-flush: Refactor the macros so the nops are defined once

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
To avoid a bug like the previous commit ever happening again, put the
nops in a single place.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Fix HRFI_TO_UNKNOWN
Michael Ellerman [Sun, 7 Jan 2018 10:52:36 +0000 (21:52 +1100)]
UBUNTU: SAUCE: rfi-flush: Fix HRFI_TO_UNKNOWN

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
We forgot to expand the number of nops in HRFI_TO_UNKNOWN when we
expanded the number of nops. The result is we actually overwrite the
rfid with a nop, which is not good. Luckily this is only used in
denorm_done, which is not hit often.

Spotted by Ram.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Fix the fallback flush to actually activate
Michael Ellerman [Sat, 6 Jan 2018 15:50:16 +0000 (21:20 +0530)]
UBUNTU: SAUCE: rfi-flush: Fix the fallback flush to actually activate

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Since we now have three nops, we need to branch further to get over
the nops to the branch to the fallback flush.

Instead of putting the branch in slot 1 and branching by 8, put it in
0 and branch all the way to keep it simple.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Put the fallback flushes in the real trampoline section
Michael Ellerman [Sat, 6 Jan 2018 15:50:07 +0000 (21:20 +0530)]
UBUNTU: SAUCE: rfi-flush: Put the fallback flushes in the real trampoline section

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Otherwise they end up somewhere random depending on what code preceeds
them, which varies depending on CONFIG options. The HRFI version at
least needs to be below __end_interrupts so that the HMI early handler
can call it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Rework pseries logic to be more cautious
Michael Ellerman [Sat, 6 Jan 2018 15:49:57 +0000 (21:19 +0530)]
UBUNTU: SAUCE: rfi-flush: Rework pseries logic to be more cautious

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Rather than assuming a successful return from the hcall will tell us a
valid flush type, if the hcall doesn't select one of the known flush
types use the fallback.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Rework powernv logic to be more cautious
Michael Ellerman [Sat, 6 Jan 2018 15:49:45 +0000 (21:19 +0530)]
UBUNTU: SAUCE: rfi-flush: Rework powernv logic to be more cautious

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Assume we need to do the fallback flush, unless firmware tells us
explicitly not to, by having the two needs-l1d-flush properties set to
disabled.

The previous logic assumed that the existence of a "fw-features"
node with no further properties was sufficient to indicate the flush
wasn't needed.

This should make no difference in practice with current firmwares,
because the "fw-features" node has only just been introduced, so there
are no machines in the wild which have an empty "fw-features" node.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Add barriers to the fallback L1D flushing
Balbir Singh [Fri, 5 Jan 2018 17:25:48 +0000 (22:55 +0530)]
UBUNTU: SAUCE: rfi-flush: Add barriers to the fallback L1D flushing

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Add a hwsync after DCBT_STOP_ALL_STREAM_IDS to order loads/
stores prior to stopping prefetch with loads and stores
as a part of the flushing. A lwsync is needed to ensure
that after we don't mix the flushing of one congruence class
with another

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Add speculation barrier before ori 30,30,0 flush
Nicholas Piggin [Fri, 5 Jan 2018 13:50:48 +0000 (19:20 +0530)]
UBUNTU: SAUCE: rfi-flush: Add speculation barrier before ori 30,30,0 flush

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
add an ori 31,31,0 speculation barrier ahead of the ori 30,30,0 flush
type, which was found necessary to completely flush out all lines.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Allow HV to advertise multiple flush types
Michael Ellerman [Fri, 5 Jan 2018 13:47:42 +0000 (19:17 +0530)]
UBUNTU: SAUCE: rfi-flush: Allow HV to advertise multiple flush types

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
To enable migration between machines with different flush types
enabled, allow the hypervisor to advertise more than one flush type,
and if we see that we patch both in. On any given machine only one
will be active (due to firmware configuration), but a kernel will be
able to migrate between machines with different flush instructions
enabled without modification.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Support more than one flush type at once
Michael Ellerman [Fri, 5 Jan 2018 13:47:17 +0000 (19:17 +0530)]
UBUNTU: SAUCE: rfi-flush: Support more than one flush type at once

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Expand the RFI section to two nop slots
Michael Ellerman [Fri, 5 Jan 2018 13:46:58 +0000 (19:16 +0530)]
UBUNTU: SAUCE: rfi-flush: Expand the RFI section to two nop slots

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Push the instruction selection down to the patching routine
Michael Ellerman [Fri, 5 Jan 2018 13:43:57 +0000 (19:13 +0530)]
UBUNTU: SAUCE: rfi-flush: Push the instruction selection down to the patching routine

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Make l1d_flush_type bit flags
Michael Ellerman [Fri, 5 Jan 2018 13:21:41 +0000 (18:51 +0530)]
UBUNTU: SAUCE: rfi-flush: Make l1d_flush_type bit flags

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
So we can select more than one.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Implement congruence-first fallback flush
Nicholas Piggin [Fri, 5 Jan 2018 12:28:06 +0000 (17:58 +0530)]
UBUNTU: SAUCE: rfi-flush: Implement congruence-first fallback flush

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
This patch chnages the fallback flush to load all ways of a set,
then move to the next set. This is the best way to flush the cache,
accoring to HW people.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: KVM: Revert the implementation of H_GET_CPU_CHARACTERISTICS
Michael Ellerman [Fri, 5 Jan 2018 12:27:24 +0000 (17:57 +0530)]
UBUNTU: SAUCE: KVM: Revert the implementation of H_GET_CPU_CHARACTERISTICS

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
After discussions this needs to be in Qemu, to deal with migration and
other complications.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: kvmppc_skip_(H)interrupt returns to host kernel
Michael Ellerman [Fri, 5 Jan 2018 12:26:52 +0000 (17:56 +0530)]
UBUNTU: SAUCE: rfi-flush: kvmppc_skip_(H)interrupt returns to host kernel

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Add HRFI_TO_UNKNOWN and use it in denorm
Michael Ellerman [Fri, 5 Jan 2018 12:25:53 +0000 (17:55 +0530)]
UBUNTU: SAUCE: rfi-flush: Add HRFI_TO_UNKNOWN and use it in denorm

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: rfi-flush: Make DEBUG_RFI a CONFIG option
Michael Ellerman [Fri, 5 Jan 2018 12:23:23 +0000 (17:53 +0530)]
UBUNTU: SAUCE: rfi-flush: Make DEBUG_RFI a CONFIG option

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoUBUNTU: SAUCE: powerpc: Secure memory rfi flush
Ananth N Mavinakayanahalli [Fri, 5 Jan 2018 04:20:56 +0000 (15:20 +1100)]
UBUNTU: SAUCE: powerpc: Secure memory rfi flush

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772
This puts a nop before each rfid/hrfid and patches in an L1-D
cache flush instruction where possible.

It provides /sys/devices/system/cpu/secure_memory_protection which can
report and can patch the rfi flushes at runtime.

This has some debug checking in the rfi instructions to make sure
we're returning to the context we think we are, so we can avoid
some flushes.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agos390: add ppa to kernel entry / exit
Martin Schwidefsky [Thu, 21 Dec 2017 08:17:59 +0000 (09:17 +0100)]
s390: add ppa to kernel entry / exit

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742771
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agos390: introduce CPU alternatives
Vasily Gorbik [Tue, 2 Jan 2018 10:26:25 +0000 (10:26 +0000)]
s390: introduce CPU alternatives

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742771
Implement CPU alternatives, which allows to optionally patch newer
instructions at runtime, based on CPU facilities availability.

A new kernel boot parameter "noaltinstr" disables patching.

Current implementation is derived from x86 alternatives. Although
ideal instructions padding (when altinstr is longer then oldinstr)
is added at compile time, and no oldinstr nops optimization has to be
done at runtime. Also couple of compile time sanity checks are done:
1. oldinstr and altinstr must be <= 254 bytes long,
2. oldinstr and altinstr must not have an odd length.

alternative(oldinstr, altinstr, facility);
alternative_2(oldinstr, altinstr1, facility1, altinstr2, facility2);

Both compile time and runtime padding consists of either 6/4/2 bytes nop
or a jump (brcl) + 2 bytes nop filler if padding is longer then 6 bytes.

.altinstructions and .altinstr_replacement sections are part of
__init_begin : __init_end region and are freed after initialization.

Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agos390/spinlock: add gmb memory barrier
Martin Schwidefsky [Mon, 18 Dec 2017 06:58:11 +0000 (07:58 +0100)]
s390/spinlock: add gmb memory barrier

CVE-2017-5753
CVE-2017-5715

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agopowerpc: add gmb barrier
Andy Whitcroft [Wed, 20 Dec 2017 12:12:08 +0000 (12:12 +0000)]
powerpc: add gmb barrier

CVE-2017-5753
CVE-2017-5715

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agox86/cpu/AMD: Remove now unused definition of MFENCE_RDTSC feature
Tom Lendacky [Wed, 20 Dec 2017 10:55:48 +0000 (10:55 +0000)]
x86/cpu/AMD: Remove now unused definition of MFENCE_RDTSC feature

CVE-2017-5753
CVE-2017-5715

With the switch to using LFENCE_RDTSC on AMD platforms there is no longer
a need for the MFENCE_RDTSC feature.  Remove it usage and definition.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agox86/svm: Add code to clear registers on VM exit
Tom Lendacky [Wed, 20 Dec 2017 10:55:47 +0000 (10:55 +0000)]
x86/svm: Add code to clear registers on VM exit

CVE-2017-5753
CVE-2017-5715

Clear registers on VM exit to prevent speculative use of them.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agox86/svm: Add code to clobber the RSB on VM exit
Tom Lendacky [Wed, 20 Dec 2017 10:55:47 +0000 (10:55 +0000)]
x86/svm: Add code to clobber the RSB on VM exit

CVE-2017-5753
CVE-2017-5715

Add code to overwrite the local CPU RSB entries from the previous less
privileged mode.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agoKVM: x86: Add speculative control CPUID support for guests
Tom Lendacky [Wed, 20 Dec 2017 10:55:47 +0000 (10:55 +0000)]
KVM: x86: Add speculative control CPUID support for guests

CVE-2017-5753
CVE-2017-5715

Provide the guest with the speculative control CPUID related values.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
6 years agox86/svm: Set IBPB when running a different VCPU
Tom Lendacky [Wed, 20 Dec 2017 10:55:47 +0000 (10:55 +0000)]
x86/svm: Set IBPB when running a different VCPU

CVE-2017-5753
CVE-2017-5715

Set IBPB (Indirect Branch Prediction Barrier) when the current CPU is
going to run a VCPU different from what was previously run.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>