Patch "powerpc/64s: Enhance the information in cpu_show_spectre_v1()" has been added to the 4.4-stable tree

2019-04-29 Thread gregkh


This is a note to let you know that I've just added the patch titled

powerpc/64s: Enhance the information in cpu_show_spectre_v1()

to the 4.4-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
 powerpc-64s-enhance-the-information-in-cpu_show_spectre_v1.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let  know about it.


>From foo@baz Mon 29 Apr 2019 11:38:37 AM CEST
From: Michael Ellerman 
Date: Mon, 22 Apr 2019 00:20:16 +1000
Subject: powerpc/64s: Enhance the information in cpu_show_spectre_v1()
To: sta...@vger.kernel.org, gre...@linuxfoundation.org
Cc: linuxppc-...@ozlabs.org, diana.crac...@nxp.com, msucha...@suse.de, 
npig...@gmail.com, christophe.le...@c-s.fr
Message-ID: <20190421142037.21881-32-...@ellerman.id.au>

From: Michal Suchanek 

commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1() when enabled.

Signed-off-by: Michal Suchanek 
Signed-off-by: Michael Ellerman 
Signed-off-by: Greg Kroah-Hartman 
---
 arch/powerpc/kernel/security.c |3 +++
 1 file changed, 3 insertions(+)

--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -121,6 +121,9 @@ ssize_t cpu_show_spectre_v1(struct devic
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+
return sprintf(buf, "Vulnerable\n");
 }
 


Patches currently in stable-queue which might be from m...@ellerman.id.au are

queue-4.4/powerpc-64s-add-support-for-a-store-forwarding-barrier-at-kernel-entry-exit.patch
queue-4.4/powerpc-64-make-stf-barrier-ppc_book3s_64-specific.patch
queue-4.4/powerpc-pseries-set-or-clear-security-feature-flags.patch
queue-4.4/powerpc-fsl-fix-spectre_v2-mitigations-reporting.patch
queue-4.4/powerpc-64s-patch-barrier_nospec-in-modules.patch
queue-4.4/powerpc-pseries-support-firmware-disable-of-rfi-flush.patch
queue-4.4/powerpc-rfi-flush-call-setup_rfi_flush-after-lpm-migration.patch
queue-4.4/powerpc-pseries-query-hypervisor-for-count-cache-flush-settings.patch
queue-4.4/powerpc-powernv-set-or-clear-security-feature-flags.patch
queue-4.4/powerpc-64s-add-support-for-software-count-cache-flush.patch
queue-4.4/powerpc64s-show-ori31-availability-in-spectre_v1-sysfs-file-not-v2.patch
queue-4.4/powerpc-fsl-flush-the-branch-predictor-at-each-kernel-entry-64bit.patch
queue-4.4/powerpc-fsl-update-spectre-v2-reporting.patch
queue-4.4/powerpc-64s-wire-up-cpu_show_spectre_v2.patch
queue-4.4/powerpc-64-make-meltdown-reporting-book3s-64-specific.patch
queue-4.4/powerpc-rfi-flush-make-it-possible-to-call-setup_rfi_flush-again.patch
queue-4.4/powerpc-64s-add-support-for-ori-barrier_nospec-patching.patch
queue-4.4/powerpc-use-barrier_nospec-in-copy_from_user.patch
queue-4.4/powerpc-64s-fix-section-mismatch-warnings-from-setup_rfi_flush.patch
queue-4.4/powerpc-avoid-code-patching-freed-init-sections.patch
queue-4.4/powerpc-fsl-add-macro-to-flush-the-branch-predictor.patch
queue-4.4/powerpc-xmon-add-rfi-flush-related-fields-to-paca-dump.patch
queue-4.4/powerpc-fsl-add-barrier_nospec-implementation-for-nxp-powerpc-book3e.patch
queue-4.4/powerpc-security-fix-spectre_v2-reporting.patch
queue-4.4/powerpc-add-security-feature-flags-for-spectre-meltdown.patch
queue-4.4/powerpc-powernv-use-the-security-flags-in-pnv_setup_rfi_flush.patch
queue-4.4/powerpc-64-disable-the-speculation-barrier-from-the-command-line.patch
queue-4.4/powerpc-fsl-fix-the-flush-of-branch-predictor.patch
queue-4.4/powerpc-pseries-use-the-security-flags-in-pseries_setup_rfi_flush.patch
queue-4.4/powerpc-64-add-config_ppc_barrier_nospec.patch
queue-4.4/powerpc-64s-move-cpu_show_meltdown.patch
queue-4.4/powerpc-64-use-barrier_nospec-in-syscall-entry.patch
queue-4.4/powerpc-fsl-add-nospectre_v2-command-line-argument.patch
queue-4.4/powerpc-64s-add-new-security-feature-flags-for-count-cache-flush.patch
queue-4.4/powerpc-fsl-add-infrastructure-to-fixup-branch-predictor-flush.patch
queue-4.4/powerpc-rfi-flush-differentiate-enabled-and-patched-flush-types.patch
queue-4.4/powerpc-64s-enhance-the-information-in-cpu_show_spectre_v1.patch
queue-4.4/powerpc-64-call-setup_barrier_nospec-from-setup_arch.patch
queue-4.4/powerpc-rfi-flush-always-enable-fallback-flush-on-pseries.patch
queue-4.4/powerpc-64s-improve-rfi-l1-d-cache-flush-fallback.patch
queue-4.4/powerpc-asm-add-a-patch_site-macro-helpers-for-patching-instructions.patch
queue-4.4/powerpc-pseries-add-new-h_get_cpu_characteristics-flags.patch
queue-4.4/powerpc-64s-enable-barrier_nospec-based-on-firmware-settings.patch
queue-4.4/powerpc-powernv-support-firmware-disable-of-rfi-flush.patch
queue-4.4/powerpc-r

[PATCH stable v4.4 31/52] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2019-04-21 Thread Michael Ellerman
From: Michal Suchanek 

commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1() when enabled.

Signed-off-by: Michal Suchanek 
Signed-off-by: Michael Ellerman 
---
 arch/powerpc/kernel/security.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index ae15f53b23d7..202083daebfb 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -121,6 +121,9 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct 
device_attribute *attr, c
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+
return sprintf(buf, "Vulnerable\n");
 }
 
-- 
2.20.1



[PATCH stable v4.9 09/35] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2019-04-11 Thread Michael Ellerman
From: Michal Suchanek 

commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1() when enabled.

Signed-off-by: Michal Suchanek 
Signed-off-by: Michael Ellerman 
---
 arch/powerpc/kernel/security.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index d0e974da4918..f189f946d935 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -121,6 +121,9 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct 
device_attribute *attr, c
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+
return sprintf(buf, "Vulnerable\n");
 }
 
-- 
2.20.1



Patch "[PATCH stable v4.14 06/32] powerpc/64s: Enhance the information in cpu_show_spectre_v1()" has been added to the 4.14-stable tree

2019-03-29 Thread gregkh


This is a note to let you know that I've just added the patch titled

[PATCH stable v4.14 06/32] powerpc/64s: Enhance the information in 
cpu_show_spectre_v1()

to the 4.14-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
 powerpc-64s-enhance-the-information-in-cpu_show_spectre_v1.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let  know about it.


>From foo@baz Fri Mar 29 15:53:50 CET 2019
From: Michael Ellerman 
Date: Fri, 29 Mar 2019 22:25:54 +1100
Subject: [PATCH stable v4.14 06/32] powerpc/64s: Enhance the information in 
cpu_show_spectre_v1()
To: sta...@vger.kernel.org, gre...@linuxfoundation.org
Cc: linuxppc-...@ozlabs.org, diana.crac...@nxp.com, msucha...@suse.de, 
christophe.le...@c-s.fr
Message-ID: <20190329112620.14489-7-...@ellerman.id.au>

From: Michael Ellerman 

From: Michal Suchanek 

commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1() when enabled.

Signed-off-by: Michal Suchanek 
Signed-off-by: Michael Ellerman 
Signed-off-by: Greg Kroah-Hartman 
---
 arch/powerpc/kernel/security.c |3 +++
 1 file changed, 3 insertions(+)

--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -120,6 +120,9 @@ ssize_t cpu_show_spectre_v1(struct devic
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+
return sprintf(buf, "Vulnerable\n");
 }
 


Patches currently in stable-queue which might be from m...@ellerman.id.au are

queue-4.14/powerpc-fsl-emulate-sprn_bucsr-register.patch
queue-4.14/powerpc-64-make-stf-barrier-ppc_book3s_64-specific.patch
queue-4.14/powerpc-fsl-fix-spectre_v2-mitigations-reporting.patch
queue-4.14/powerpc-64s-patch-barrier_nospec-in-modules.patch
queue-4.14/powerpc-pseries-query-hypervisor-for-count-cache-flush-settings.patch
queue-4.14/powerpc-64s-add-support-for-software-count-cache-flush.patch
queue-4.14/powerpc64s-show-ori31-availability-in-spectre_v1-sysfs-file-not-v2.patch
queue-4.14/powerpc-fsl-flush-the-branch-predictor-at-each-kernel-entry-64bit.patch
queue-4.14/powerpc-fsl-update-spectre-v2-reporting.patch
queue-4.14/powerpc-64-make-meltdown-reporting-book3s-64-specific.patch
queue-4.14/powerpc-64s-add-support-for-ori-barrier_nospec-patching.patch
queue-4.14/powerpc-use-barrier_nospec-in-copy_from_user.patch
queue-4.14/powerpc-fsl-sanitize-the-syscall-table-for-nxp-powerpc-32-bit-platforms.patch
queue-4.14/powerpc-fsl-add-macro-to-flush-the-branch-predictor.patch
queue-4.14/powerpc-fsl-add-barrier_nospec-implementation-for-nxp-powerpc-book3e.patch
queue-4.14/powerpc-security-fix-spectre_v2-reporting.patch
queue-4.14/powerpc-64-disable-the-speculation-barrier-from-the-command-line.patch
queue-4.14/powerpc-fsl-fix-the-flush-of-branch-predictor.patch
queue-4.14/powerpc-64-add-config_ppc_barrier_nospec.patch
queue-4.14/powerpc-fsl-enable-runtime-patching-if-nospectre_v2-boot-arg-is-used.patch
queue-4.14/powerpc-64-use-barrier_nospec-in-syscall-entry.patch
queue-4.14/powerpc-fsl-fixed-warning-orphan-section-__btb_flush_fixup.patch
queue-4.14/powerpc-fsl-add-nospectre_v2-command-line-argument.patch
queue-4.14/powerpc-64s-add-new-security-feature-flags-for-count-cache-flush.patch
queue-4.14/powerpc-fsl-add-infrastructure-to-fixup-branch-predictor-flush.patch
queue-4.14/powerpc-64s-enhance-the-information-in-cpu_show_spectre_v1.patch
queue-4.14/powerpc-64-call-setup_barrier_nospec-from-setup_arch.patch
queue-4.14/powerpc-asm-add-a-patch_site-macro-helpers-for-patching-instructions.patch
queue-4.14/powerpc-fsl-flush-the-branch-predictor-at-each-kernel-entry-32-bit.patch
queue-4.14/powerpc-64s-enable-barrier_nospec-based-on-firmware-settings.patch
queue-4.14/powerpc-fsl-flush-branch-predictor-when-entering-kvm.patch
queue-4.14/powerpc-powernv-query-firmware-for-count-cache-flush-settings.patch


[PATCH stable v4.14 06/32] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2019-03-29 Thread Michael Ellerman
From: Michal Suchanek 

commit a377514519b9a20fa1ea9adddbb4129573129cef upstream.

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1() when enabled.

Signed-off-by: Michal Suchanek 
Signed-off-by: Michael Ellerman 
---
 arch/powerpc/kernel/security.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 7553951b500a..a8b277362931 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -120,6 +120,9 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct 
device_attribute *attr, c
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+
return sprintf(buf, "Vulnerable\n");
 }
 
-- 
2.20.1



Re: powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-28 at 13:19:14 UTC, Michal Suchanek wrote:
> We now have barrier_nospec as mitigation so print it in
> cpu_show_spectre_v1 when enabled.
> 
> Signed-off-by: Michal Suchanek 

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a377514519b9a20fa1ea9adddbb412

cheers


Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-29 Thread Joe Perches
On Tue, 2018-05-29 at 15:24 +, Christophe Leroy wrote:
> On 05/29/2018 02:46 PM, Michal Suchánek wrote:
> > On Tue, 29 May 2018 16:13:49 +0200 Christophe LEROY 
> >  wrote:
[]
> > diff --git a/arch/powerpc/kernel/security.c
> > > > b/arch/powerpc/kernel/security.c index 0239383c7e4d..a0c32d53980b
> > > > 100644 --- a/arch/powerpc/kernel/security.c
> > > > +++ b/arch/powerpc/kernel/security.c
> > > > @@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device
> > > > *dev, struct device_attribute *attr, c if
> > > > (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR)) return
> > > > sprintf(buf, "Not affected\n");
> > > > -   return sprintf(buf, "Vulnerable\n");
> > > > +   if (barrier_nospec_enabled)
> > > > +   return sprintf(buf, "Mitigation: __user pointer
> > > > sanitization\n");
> > > > +   else
> > > > +   return sprintf(buf, "Vulnerable\n");
> > > 
> > > Checkpatch would tell you that an else is unneeded after a return. So
> > > just leave it as it was before.
> > 
> > Where did you get your copy of checkpatch? The one in Linux tree does
> > not do that.

Correct as this particular style is a maintainer preference.

> Strange, it should, as checkpatch.pl includes the following code:
> 
> # check indentation of any line with a bare else
> # (but not if it is a multiple line "if (foo) return bar; else return baz;")

Note this comment and also that this case is

if (foo)
return bar;
else
return baz;

so no warning is generated.

> # if the previous line is a break or return and is indented 1 tab more...
>   if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) {
>   my $tabs = length($1) + 1;
>   if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ ||
>   ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ &&
>defined $lines[$linenr] &&
>$lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) 
> {
>   WARN("UNNECESSARY_ELSE",
>"else is not generally useful after a 
> break or return\n" . 
> $hereprev);
>   }
>   }
> 
> 
> Anyway, you should remove that 'else' in your patch.
> And the other sprintf line is over 80 characters.
> 
> Christophe
> 
> > 
> > Thanks
> > 
> > Michal
> > 


Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-29 Thread Christophe Leroy




On 05/29/2018 02:46 PM, Michal Suchánek wrote:

On Tue, 29 May 2018 16:13:49 +0200
Christophe LEROY  wrote:


Le 28/05/2018 à 15:19, Michal Suchanek a écrit :

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1 when enabled.

Signed-off-by: Michal Suchanek 
---
   arch/powerpc/kernel/security.c | 5 -
   1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c
b/arch/powerpc/kernel/security.c index 0239383c7e4d..a0c32d53980b
100644 --- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device
*dev, struct device_attribute *attr, c if
(!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR)) return
sprintf(buf, "Not affected\n");
-   return sprintf(buf, "Vulnerable\n");
+   if (barrier_nospec_enabled)



+   return sprintf(buf, "Mitigation: __user pointer
sanitization\n");
+   else
+   return sprintf(buf, "Vulnerable\n");


Checkpatch would tell you that an else is unneeded after a return. So
just leave it as it was before.


Where did you get your copy of checkpatch? The one in Linux tree does
not do that.


Strange, it should, as checkpatch.pl includes the following code:

# check indentation of any line with a bare else
# (but not if it is a multiple line "if (foo) return bar; else return baz;")
# if the previous line is a break or return and is indented 1 tab more...
if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) {
my $tabs = length($1) + 1;
if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ ||
($prevline =~ /^\+\t{$tabs,$tabs}return\b/ &&
 defined $lines[$linenr] &&
 $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) 
{
WARN("UNNECESSARY_ELSE",
 "else is not generally useful after a break or return\n" . 
$hereprev);

}
}


Anyway, you should remove that 'else' in your patch.
And the other sprintf line is over 80 characters.

Christophe



Thanks

Michal



Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-29 Thread Michal Suchánek
On Tue, 29 May 2018 16:13:49 +0200
Christophe LEROY  wrote:

> Le 28/05/2018 à 15:19, Michal Suchanek a écrit :
> > We now have barrier_nospec as mitigation so print it in
> > cpu_show_spectre_v1 when enabled.
> > 
> > Signed-off-by: Michal Suchanek 
> > ---
> >   arch/powerpc/kernel/security.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/powerpc/kernel/security.c
> > b/arch/powerpc/kernel/security.c index 0239383c7e4d..a0c32d53980b
> > 100644 --- a/arch/powerpc/kernel/security.c
> > +++ b/arch/powerpc/kernel/security.c
> > @@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device
> > *dev, struct device_attribute *attr, c if
> > (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR)) return
> > sprintf(buf, "Not affected\n"); 
> > -   return sprintf(buf, "Vulnerable\n");
> > +   if (barrier_nospec_enabled)  
> 
> > +   return sprintf(buf, "Mitigation: __user pointer
> > sanitization\n");
> > +   else
> > +   return sprintf(buf, "Vulnerable\n");  
> 
> Checkpatch would tell you that an else is unneeded after a return. So 
> just leave it as it was before.

Where did you get your copy of checkpatch? The one in Linux tree does
not do that.

Thanks

Michal


Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-29 Thread Christophe LEROY




Le 28/05/2018 à 15:19, Michal Suchanek a écrit :

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1 when enabled.

Signed-off-by: Michal Suchanek 
---
  arch/powerpc/kernel/security.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 0239383c7e4d..a0c32d53980b 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct 
device_attribute *attr, c
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
  
-	return sprintf(buf, "Vulnerable\n");

+   if (barrier_nospec_enabled)



+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+   else
+   return sprintf(buf, "Vulnerable\n");


Checkpatch would tell you that an else is unneeded after a return. So 
just leave it as it was before.


Christophe


  }
  
  ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, char *buf)




Re: [PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-29 Thread kbuild test robot
Hi Michal,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.17-rc7 next-20180529]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Michal-Suchanek/powerpc-64s-Enhance-the-information-in-cpu_show_spectre_v1/20180529-181036
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/security.c: In function 'cpu_show_spectre_v1':
>> arch/powerpc/kernel/security.c:54:6: error: 'barrier_nospec_enabled' 
>> undeclared (first use in this function); did you mean 'kernfs_ns_enabled'?
 if (barrier_nospec_enabled)
 ^~
 kernfs_ns_enabled
   arch/powerpc/kernel/security.c:54:6: note: each undeclared identifier is 
reported only once for each function it appears in
   arch/powerpc/kernel/security.c:58:1: error: control reaches end of non-void 
function [-Werror=return-type]
}
^
   cc1: all warnings being treated as errors

vim +54 arch/powerpc/kernel/security.c

48  
49  ssize_t cpu_show_spectre_v1(struct device *dev, struct device_attribute 
*attr, char *buf)
50  {
51  if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
52  return sprintf(buf, "Not affected\n");
53  
  > 54  if (barrier_nospec_enabled)
55  return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
56  else
57  return sprintf(buf, "Vulnerable\n");
58  }
59  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH] powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-05-28 Thread Michal Suchanek

We now have barrier_nospec as mitigation so print it in
cpu_show_spectre_v1 when enabled.

Signed-off-by: Michal Suchanek 
---
 arch/powerpc/kernel/security.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 0239383c7e4d..a0c32d53980b 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -120,7 +120,10 @@ ssize_t cpu_show_spectre_v1(struct device *dev, struct 
device_attribute *attr, c
if (!security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR))
return sprintf(buf, "Not affected\n");
 
-   return sprintf(buf, "Vulnerable\n");
+   if (barrier_nospec_enabled)
+   return sprintf(buf, "Mitigation: __user pointer 
sanitization\n");
+   else
+   return sprintf(buf, "Vulnerable\n");
 }
 
 ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, 
char *buf)
-- 
2.13.6