Hello,
New to this list, I'm working on integrating Op-Tee into ChromeOS ARM
devices for the purpose of Widevine DRM.
Does anybody know if Op-Tee creates mappings in the MMU that go beyond
the registered TZ memory region and the static non-secure shared
memory region?
TL;DR
Does anyone know if there would be problems associated with invoking
register_ddr()[1] with a size larger than the physical RAM size? The
reason I want to do this is because we have multiple different SKUs
for the same reference board, and for ChromeOS we build per-board
images and not per-SKU images. We could use a DT to do this, but
that's running into other issues...so I'm trying to determine if this
easy fix will solve the problem w/out creating new ones. (it does
work fine when I test it)
I understand that an exploited normal world could send a PA pointing
to a region outside of the physical bounds for dynamic shared memory,
and then Op-Tee would try to map that and undesirable things may
happen (but I don't think they would lead to secure world exploits
since the memory will be mapped as non-secure, so it shouldn't be any
worse that the normal world trying to access physical memory out of
bounds).
One of the main concerns is around whether Op-Tee is creating mappings
in the MMU that reference the whole nonsecure DDR size for some other
reason. Then the CPU may do speculative execution and try to access
the physical memory at that invalid mapping and create problems, which
could then lead to failure when someone isn't trying to exploit the
system.
Does anybody know if Op-Tee creates mappings in the MMU that go beyond
the registered TZ memory region and the static non-secure shared
memory region?
[1] https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/plat-mediatek/…
Thanks,
--
Jeffrey Kardatzke
jkardatzke(a)google.com
Google, Inc.
Hello arm-soc maintainers,
Please pull this small patch which adds __init/__exit annotations to the
OP-TEE driver module.
Thanks,
Jens
The following changes since commit 4fe89d07dcc2804c8b562f6c7896a45643d34b2f:
Linux 6.0 (2022-10-02 14:09:07 -0700)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/optee-for-6.2
for you to fetch changes up to bd52407221b4702af690456b2b6006fa6440e893:
optee: Add __init/__exit annotations to module init/exit funcs (2022-10-11 11:20:16 +0200)
----------------------------------------------------------------
Add missing __init/__exit annotations to OP-TEE driver
----------------------------------------------------------------
Xiu Jianfeng (1):
optee: Add __init/__exit annotations to module init/exit funcs
drivers/tee/optee/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
If device_register() returns error in optee_register_device(),
the name allocated by dev_set_name() need be freed. As comment
of device_register() says, it should use put_device() to give
up the reference in the error path. So fix this by calling
put_device(), then the name can be freed in kobject_cleanup(),
and optee_device is freed in optee_release_device().
Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
---
drivers/tee/optee/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c
index f3947be13e2e..64f0e047c23d 100644
--- a/drivers/tee/optee/device.c
+++ b/drivers/tee/optee/device.c
@@ -80,7 +80,7 @@ static int optee_register_device(const uuid_t *device_uuid)
rc = device_register(&optee_device->dev);
if (rc) {
pr_err("device registration failed, err: %d\n", rc);
- kfree(optee_device);
+ put_device(&optee_device->dev);
}
return rc;
--
2.25.1
Hello arm-soc maintainers,
Please pull this small patch in the OP-TEE driver which fixes a possible
memory leak in the error path of optee_register_device().
Thanks,
Jens
The following changes since commit 094226ad94f471a9f19e8f8e7140a09c2625abaa:
Linux 6.1-rc5 (2022-11-13 13:12:55 -0800)
are available in the Git repository at:
https://git.linaro.org/people/jens.wiklander/linux-tee.git tags/optee-fix-for-6.1
for you to fetch changes up to cce616e012c215d65c15e5d1afa73182dea49389:
tee: optee: fix possible memory leak in optee_register_device() (2022-11-17 09:22:12 +0100)
----------------------------------------------------------------
Fix possible memory leak in optee_register_device()
----------------------------------------------------------------
Yang Yingliang (1):
tee: optee: fix possible memory leak in optee_register_device()
drivers/tee/optee/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
If device_register() returns error in optee_register_device(),
name of kobject which is allocated in dev_set_name() called in device_add()
is leaked.
Never directly free @dev after calling device_register(), even
if it returned an error! Always use put_device() to give up the
reference initialized.
Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
Signed-off-by: ruanjinjie <ruanjinjie(a)huawei.com>
---
drivers/tee/optee/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c
index f3947be13e2e..64f0e047c23d 100644
--- a/drivers/tee/optee/device.c
+++ b/drivers/tee/optee/device.c
@@ -80,7 +80,7 @@ static int optee_register_device(const uuid_t *device_uuid)
rc = device_register(&optee_device->dev);
if (rc) {
pr_err("device registration failed, err: %d\n", rc);
- kfree(optee_device);
+ put_device(&optee_device->dev);
}
return rc;
--
2.25.1
Hi,
For time and connection details see the calendar at
https://www.trustedfirmware.org/meetings/
I have one topic for the LOC:
Can we deprecate paging of OP-TEE on Armv8-A platforms using FF-A?
Any other topic?
Thanks,
Jens
Currently there is no dependency between the "linaro,scmi-optee" driver
and the tee_core. If the scmi-optee driver gets probed before the
tee_bus_type is initialized, then we will get an unwanted error print.
This patch enables putting scmi-optee nodes as children to the optee
node in devicetree, which indirectly creates the missing dependency.
Signed-off-by: Ludvig Pärsson <ludvig.parsson(a)axis.com>
---
drivers/tee/optee/smc_abi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
index a1c1fa1a9c28..be6f02fd5a7f 100644
--- a/drivers/tee/optee/smc_abi.c
+++ b/drivers/tee/optee/smc_abi.c
@@ -1533,6 +1533,11 @@ static int optee_probe(struct platform_device *pdev)
if (rc)
goto err_disable_shm_cache;
+ /* Populate any dependent child node (if any) */
+ rc = devm_of_platform_populate(&pdev->dev);
+ if (rc)
+ goto err_disable_shm_cache;
+
pr_info("initialized driver\n");
return 0;
--
2.30.2