1 From 403103d2fab584f18fbb402a7d0f2bdc81774844 Mon Sep 17 00:00:00 2001
2 From: Michal Suchanek <msuchanek@suse.de>
3 Date: Thu, 11 Apr 2019 21:46:04 +1000
4 Subject: powerpc/64s: Enhance the information in cpu_show_spectre_v1()
6 commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.
8 We now have barrier_nospec as mitigation so print it in
9 cpu_show_spectre_v1() when enabled.
11 Signed-off-by: Michal Suchanek <msuchanek@suse.de>
12 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
13 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 arch/powerpc/kernel/security.c | 3 +++
16 1 file changed, 3 insertions(+)
18 diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
19 index d0e974da4918..f189f946d935 100644
20 --- a/arch/powerpc/kernel/security.c
21 +++ b/arch/powerpc/kernel/security.c
22 @@ -121,6 +121,9 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute *attr, c
23 if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
24 return sprintf(buf, "Not affected\n");
26 + if (barrier_nospec_enabled)
27 + return sprintf(buf, "Mitigation: __user pointer sanitization\n");
29 return sprintf(buf, "Vulnerable\n");