linux-stable/arch/powerpc
Andrew Donnellan f74dcbfd27 powerpc/pseries: Fix handling of PLPKS object flushing timeout
plpks_confirm_object_flushed() uses the H_PKS_CONFIRM_OBJECT_FLUSHED hcall
to check whether changes to an object in the Platform KeyStore have been
flushed to non-volatile storage.

The hcall returns two output values, the return code and the flush status.
plpks_confirm_object_flushed() polls the hcall until either the flush
status has updated, the return code is an error, or a timeout has been
exceeded.

While we're still polling, the hcall is returning H_SUCCESS (0) as the
return code. In the timeout case, this means that upon exiting the polling
loop, rc is 0, and therefore 0 is returned to the user.

Handle the timeout case separately and return ETIMEDOUT if triggered.

Fixes: 2454a7af0f ("powerpc/pseries: define driver for Platform KeyStore")
Reported-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Tested-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230210080401.345462-2-ajd@linux.ibm.com
2023-02-12 22:12:36 +11:00
..
boot Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
configs powerpc/ps3: Refresh ps3_defconfig 2023-02-12 22:11:38 +11:00
crypto crypto: powerpc - Use address generation helper for asm 2023-02-10 22:17:36 +11:00
include Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
kernel Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
kexec powerpc/kexec_file: fix implicit decl error 2023-02-06 22:00:30 +11:00
kvm powerpc/kvm: Fix unannotated intra-function call warning 2023-01-30 16:01:04 +11:00
lib powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
net powerpc/bpf/32: perform three operands ALU operations 2023-02-10 22:17:35 +11:00
perf Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
platforms powerpc/pseries: Fix handling of PLPKS object flushing timeout 2023-02-12 22:12:36 +11:00
purgatory powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
sysdev powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc/kcsan: Add exclusions from instrumentation 2023-02-10 22:19:56 +11:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Merge branch 'fixes' into next 2023-02-12 22:11:56 +11:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile powerpc/64: Set default CPU in Kconfig 2023-01-30 17:41:28 +11:00
Makefile.postlink