driver core: cpu: Make cpu_show_not_affected() static

JIRA: https://issues.redhat.com/browse/RHEL-8594
CVE: CVE-2023-20569

commit 6524c798b727ffdb5c7eaed2f50e8e839997df8e
Author: Borislav Petkov (AMD) <bp@alien8.de>
Date:   Thu, 10 Aug 2023 13:22:29 +0200

    driver core: cpu: Make cpu_show_not_affected() static

    Fix a -Wmissing-prototypes warning and add the gather_data_sampling()
    stub macro call for real.

    Fixes: 0fddfe338210 ("driver core: cpu: Unify redundant silly stubs")
    Closes: https://lore.kernel.org/oe-kbuild-all/202308101956.oRj1ls7s-lkp@intel.com
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Link: https://lore.kernel.org/r/202308101956.oRj1ls7s-lkp@intel.com

Signed-off-by: Waiman Long <longman@redhat.com>
This commit is contained in:
Waiman Long 2023-09-25 13:57:23 -04:00
parent c652fb198e
commit e3ed7f8e75
1 changed files with 2 additions and 8 deletions

View File

@ -508,7 +508,7 @@ static void __init cpu_dev_register_generic(void)
} }
#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES #ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
ssize_t cpu_show_not_affected(struct device *dev, static ssize_t cpu_show_not_affected(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
return sysfs_emit(buf, "Not affected\n"); return sysfs_emit(buf, "Not affected\n");
@ -533,12 +533,6 @@ CPU_SHOW_VULN_FALLBACK(retbleed);
CPU_SHOW_VULN_FALLBACK(spec_rstack_overflow); CPU_SHOW_VULN_FALLBACK(spec_rstack_overflow);
CPU_SHOW_VULN_FALLBACK(gather_data_sampling); CPU_SHOW_VULN_FALLBACK(gather_data_sampling);
ssize_t __weak cpu_show_gds(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sysfs_emit(buf, "Not affected\n");
}
static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL); static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL); static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL); static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
@ -551,7 +545,7 @@ static DEVICE_ATTR(srbds, 0444, cpu_show_srbds, NULL);
static DEVICE_ATTR(mmio_stale_data, 0444, cpu_show_mmio_stale_data, NULL); static DEVICE_ATTR(mmio_stale_data, 0444, cpu_show_mmio_stale_data, NULL);
static DEVICE_ATTR(retbleed, 0444, cpu_show_retbleed, NULL); static DEVICE_ATTR(retbleed, 0444, cpu_show_retbleed, NULL);
static DEVICE_ATTR(spec_rstack_overflow, 0444, cpu_show_spec_rstack_overflow, NULL); static DEVICE_ATTR(spec_rstack_overflow, 0444, cpu_show_spec_rstack_overflow, NULL);
static DEVICE_ATTR(gather_data_sampling, 0444, cpu_show_gds, NULL); static DEVICE_ATTR(gather_data_sampling, 0444, cpu_show_gather_data_sampling, NULL);
static struct attribute *cpu_root_vulnerabilities_attrs[] = { static struct attribute *cpu_root_vulnerabilities_attrs[] = {
&dev_attr_meltdown.attr, &dev_attr_meltdown.attr,