Skip to content

Commit 5698601

Browse files
committed
powerpc/64s: Wire up cpu_show_spectre_v1()
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>
1 parent 2e4a161 commit 5698601

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/powerpc/kernel/security.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,11 @@ ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, cha
5050

5151
return sprintf(buf, "Vulnerable\n");
5252
}
53+
54+
ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, char *buf)
55+
{
56+
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
57+
return sprintf(buf, "Not affected\n");
58+
59+
return sprintf(buf, "Vulnerable\n");
60+
}

0 commit comments

Comments
 (0)