]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Revert "sysfs/cpu: Add vulnerability folder"
authorKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 12 Jan 2018 10:53:30 +0000 (11:53 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 12 Jan 2018 11:04:47 +0000 (12:04 +0100)
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>
Documentation/ABI/testing/sysfs-devices-system-cpu
drivers/base/Kconfig
drivers/base/cpu.c
include/linux/cpu.h

index bd3a88e16d8b456b27fe7491742c72a5926e2b08..f3d5817c4ef0fae54150bc3e772e7cc535bde805 100644 (file)
@@ -373,19 +373,3 @@ Contact:   Linux kernel mailing list <linux-kernel@vger.kernel.org>
 Description:   information about CPUs heterogeneity.
 
                cpu_capacity: capacity of cpu#.
-
-What:          /sys/devices/system/cpu/vulnerabilities
-               /sys/devices/system/cpu/vulnerabilities/meltdown
-               /sys/devices/system/cpu/vulnerabilities/spectre_v1
-               /sys/devices/system/cpu/vulnerabilities/spectre_v2
-Date:          Januar 2018
-Contact:       Linux kernel mailing list <linux-kernel@vger.kernel.org>
-Description:   Information about CPU vulnerabilities
-
-               The files are named after the code names of CPU
-               vulnerabilities. The output of those files reflects the
-               state of the CPUs in the system. Possible output values:
-
-               "Not affected"    CPU is not affected by the vulnerability
-               "Vulnerable"      CPU is affected and no mitigation in effect
-               "Mitigation: $M"  CPU is affetcted and mitigation $M is in effect
index 5a425579f6232722fdce61eea23204be359b1d39..f046d21de57dd956819ad4227535667a0b74cbe9 100644 (file)
@@ -237,9 +237,6 @@ config GENERIC_CPU_DEVICES
 config GENERIC_CPU_AUTOPROBE
        bool
 
-config GENERIC_CPU_VULNERABILITIES
-       bool
-
 config SOC_BUS
        bool
        select GLOB
index afb575e25f15a9110783de9fabe36e1c13bdfeee..2c3b359b3536a15cdb21fbc60af80644368c655d 100644 (file)
@@ -501,58 +501,10 @@ static void __init cpu_dev_register_generic(void)
 #endif
 }
 
-#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
-
-ssize_t __weak cpu_show_meltdown(struct device *dev,
-                                struct device_attribute *attr, char *buf)
-{
-       return sprintf(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v1(struct device *dev,
-                                  struct device_attribute *attr, char *buf)
-{
-       return sprintf(buf, "Not affected\n");
-}
-
-ssize_t __weak cpu_show_spectre_v2(struct device *dev,
-                                  struct device_attribute *attr, char *buf)
-{
-       return sprintf(buf, "Not affected\n");
-}
-
-static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
-static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
-static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
-
-static struct attribute *cpu_root_vulnerabilities_attrs[] = {
-       &dev_attr_meltdown.attr,
-       &dev_attr_spectre_v1.attr,
-       &dev_attr_spectre_v2.attr,
-       NULL
-};
-
-static const struct attribute_group cpu_root_vulnerabilities_group = {
-       .name  = "vulnerabilities",
-       .attrs = cpu_root_vulnerabilities_attrs,
-};
-
-static void __init cpu_register_vulnerabilities(void)
-{
-       if (sysfs_create_group(&cpu_subsys.dev_root->kobj,
-                              &cpu_root_vulnerabilities_group))
-               pr_err("Unable to register CPU vulnerabilities\n");
-}
-
-#else
-static inline void cpu_register_vulnerabilities(void) { }
-#endif
-
 void __init cpu_dev_init(void)
 {
        if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups))
                panic("Failed to register CPU subsystem");
 
        cpu_dev_register_generic();
-       cpu_register_vulnerabilities();
 }
index 85f04d0fb18a9ee363f01233274dab573c368a75..ca73bc1563f4e131884e151ddd65dce24978c96d 100644 (file)
@@ -46,13 +46,6 @@ extern void cpu_remove_dev_attr(struct device_attribute *attr);
 extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
 extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);
 
-extern ssize_t cpu_show_meltdown(struct device *dev,
-                                struct device_attribute *attr, char *buf);
-extern ssize_t cpu_show_spectre_v1(struct device *dev,
-                                  struct device_attribute *attr, char *buf);
-extern ssize_t cpu_show_spectre_v2(struct device *dev,
-                                  struct device_attribute *attr, char *buf);
-
 extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,
                                 const struct attribute_group **groups,