linux-stable/drivers/tee/optee
Tyler Hicks 5e9d820214 optee: Clear stale cache entries during initialization
commit b5c10dd04b upstream.

The shm cache could contain invalid addresses if
optee_disable_shm_cache() was not called from the .shutdown hook of the
previous kernel before a kexec. These addresses could be unmapped or
they could point to mapped but unintended locations in memory.

Clear the shared memory cache, while being careful to not translate the
addresses returned from OPTEE_SMC_DISABLE_SHM_CACHE, during driver
initialization. Once all pre-cache shm objects are removed, proceed with
enabling the cache so that we know that we can handle cached shm objects
with confidence later in the .shutdown hook.

Cc: stable@vger.kernel.org
Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 13:22:13 +02:00
..
call.c optee: Clear stale cache entries during initialization 2021-08-12 13:22:13 +02:00
core.c optee: Clear stale cache entries during initialization 2021-08-12 13:22:13 +02:00
device.c optee: enable support for multi-stage bus enumeration 2020-07-10 09:41:53 +02:00
Kconfig tee: optee: Fix compilation issue with nommu 2020-01-23 10:55:20 +01:00
Makefile
optee_msg.h optee: use export_uuid() to copy client UUID 2021-06-10 13:39:21 +02:00
optee_private.h optee: Clear stale cache entries during initialization 2021-08-12 13:22:13 +02:00
optee_smc.h driver: tee: Handle NULL pointer indication from client 2020-08-21 08:55:13 +02:00
rpc.c optee: simplify i2c access 2021-03-04 11:37:28 +01:00
shm_pool.c optee: Fix multi page dynamic shm pool alloc 2020-01-03 11:21:12 +01:00
shm_pool.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
supp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00