]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: flush L1D after user accesses
authorNicholas Piggin <npiggin@gmail.com>
Tue, 17 Nov 2020 05:59:13 +0000 (16:59 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 Nov 2020 12:47:18 +0000 (23:47 +1100)
commit7a4361e6ba141063561264f54ddce8f2fd32bc8a
treee9f7d6a2b72ddc59cb30cc87a36e635c2e0ab243
parent6d3f0007d161518c70aba3935f82de568b154f47
powerpc/64s: flush L1D after user accesses

IBM Power9 processors can speculatively operate on data in the L1 cache
before it has been completely validated, via a way-prediction mechanism. It
is not possible for an attacker to determine the contents of impermissible
memory using this method, since these systems implement a combination of
hardware and software security measures to prevent scenarios where
protected data could be leaked.

However these measures don't address the scenario where an attacker induces
the operating system to speculatively execute instructions using data that
the attacker controls. This can be used for example to speculatively bypass
"kernel user access prevention" techniques, as discovered by Anthony
Steinhauser of Google's Safeside Project. This is not an attack by itself,
but there is a possibility it could be used in conjunction with
side-channels or other weaknesses in the privileged code to construct an
attack.

This issue can be mitigated by flushing the L1 cache between privilege
boundaries of concern. This patch flushes the L1 cache after user accesses.

This is part of the fix for CVE-2020-4788.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
13 files changed:
Documentation/admin-guide/kernel-parameters.txt
arch/powerpc/include/asm/book3s/64/kup-radix.h
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/feature-fixups.h
arch/powerpc/include/asm/kup.h
arch/powerpc/include/asm/security_features.h
arch/powerpc/include/asm/setup.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/lib/feature-fixups.c
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/pseries/setup.c