android_kernel_samsung_a7y1.../arch
Gustavo L. F. Walbon a43c324f55 powerpc/security: Fix wrong message when RFI Flush is disable
[ Upstream commit 4e706af3cd8e1d0503c25332b30cad33c97ed442 ]

The issue was showing "Mitigation" message via sysfs whatever the
state of "RFI Flush", but it should show "Vulnerable" when it is
disabled.

If you have "L1D private" feature enabled and not "RFI Flush" you are
vulnerable to meltdown attacks.

"RFI Flush" is the key feature to mitigate the meltdown whatever the
"L1D private" state.

SEC_FTR_L1D_THREAD_PRIV is a feature for Power9 only.

So the message should be as the truth table shows:

  CPU | L1D private | RFI Flush |                sysfs
  ----|-------------|-----------|-------------------------------------
   P9 |    False    |   False   | Vulnerable
   P9 |    False    |   True    | Mitigation: RFI Flush
   P9 |    True     |   False   | Vulnerable: L1D private per thread
   P9 |    True     |   True    | Mitigation: RFI Flush, L1D private per thread
   P8 |    False    |   False   | Vulnerable
   P8 |    False    |   True    | Mitigation: RFI Flush

Output before this fix:
  # cat /sys/devices/system/cpu/vulnerabilities/meltdown
  Mitigation: RFI Flush, L1D private per thread
  # echo 0 > /sys/kernel/debug/powerpc/rfi_flush
  # cat /sys/devices/system/cpu/vulnerabilities/meltdown
  Mitigation: L1D private per thread

Output after fix:
  # cat /sys/devices/system/cpu/vulnerabilities/meltdown
  Mitigation: RFI Flush, L1D private per thread
  # echo 0 > /sys/kernel/debug/powerpc/rfi_flush
  # cat /sys/devices/system/cpu/vulnerabilities/meltdown
  Vulnerable: L1D private per thread

Signed-off-by: Gustavo L. F. Walbon <gwalbon@linux.ibm.com>
Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190502210907.42375-1-gwalbon@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 13:23:18 +02:00
..
alpha A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
arc ARC: perf: Accommodate big-endian CPU 2020-04-07 12:37:04 +02:00
arm ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() 2020-04-07 13:12:51 +02:00
arm64 arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill() 2020-04-07 13:20:51 +02:00
avr32 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blackfin A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
c6x A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cris A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
frv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2020-04-06 14:21:05 +02:00
hexagon A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ia64 ia64:unwind: fix double free for mod->arch.init_unw_table 2020-04-07 07:38:19 +02:00
m32r A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m68k bug.h: work around GCC PR82365 in BUG() 2020-04-06 19:20:52 +02:00
metag A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
microblaze microblaze: move "... is ready" messages to arch/microblaze/Makefile 2020-04-07 12:41:36 +02:00
mips MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition 2020-04-07 12:45:27 +02:00
mn10300 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nios2 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
openrisc openrisc: Fix broken paths to arch/or32 2020-04-07 12:42:07 +02:00
parisc parisc: Fix vmap memory leak in ioremap()/iounmap() 2020-04-07 09:26:56 +02:00
powerpc powerpc/security: Fix wrong message when RFI Flush is disable 2020-04-07 13:23:18 +02:00
s390 KVM: s390: unregister debug feature on failing arch init 2020-04-07 12:41:46 +02:00
score A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sh pinctrl: sh-pfc: sh7734: Fix duplicate TCLK1_B 2020-04-07 13:20:55 +02:00
sparc sparc64: Rework xchg() definition to avoid warnings. 2020-04-07 12:35:33 +02:00
tile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
um um: Make GCOV depend on !KCOV 2020-04-07 12:42:32 +02:00
unicore32 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
x86 x86/crash: Add a forward declaration of struct kimage 2020-04-07 13:21:37 +02:00
xtensa xtensa: fix TLB sanity checker 2020-04-07 13:12:45 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30