]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
powerpc/64s: Wire up cpu_show_spectre_v1()
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Mar 2018 12:01:52 +0000 (23:01 +1100)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 9 Apr 2018 21:04:04 +0000 (16:04 -0500)
BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5753

Add a definition for cpu_show_spectre_v1() to override the generic
version. Currently this just prints "Not affected" or "Vulnerable"
based on the firmware flag.

Although the kernel does have array_index_nospec() in a few places, we
haven't yet audited all the powerpc code to see where it's necessary,
so for now we don't list that as a mitigation.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 56986016cb8cd9050e601831fe89f332b4e3c46e linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/kernel/security.c

index 865db6f8bccad98ef37c27deec2d489db608501e..0eace3cac818e25dd13a7d4be6efc86997049390 100644 (file)
@@ -50,3 +50,11 @@ ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, cha
 
        return sprintf(buf, "Vulnerable\n");
 }
+
+ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
+               return sprintf(buf, "Not affected\n");
+
+       return sprintf(buf, "Vulnerable\n");
+}