You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tee: validate TA-supplied pointers in secure-kernel syscalls
The copy helpers tee_svc_copy_to_user/tee_svc_copy_from_user and the live
crypto syscalls (utee_hash_update/final, utee_cipher_init, cipher update,
copy_in_attrs) dereferenced or memcpy'd TA-supplied pointer ranges with their
tee_mmu_check_access_rights() guard commented out. A malicious or buggy TA
could pass a NULL or wrapping range and drive an out-of-bounds copy in the
secure world.
This port has no per-TA MMU/MPU context or region table, and every call site
requests TEE_MEMORY_ACCESS_ANY_OWNER, so ownership cannot (and is not meant to)
be enforced. Implement tee_mmu_check_access_rights() as the accessibility check
that is meaningful here - reject NULL+len and address-space-wrapping ranges,
mirroring cmse_check_address_range()'s end-of-range test on the non-secure
boundary - and restore the guard at every live call site, including the
copy_in_attrs path that stores unvalidated attribute buffers later memcpy'd by
op_attr_secret_value_from_user.
Add a temporary CONFIG_APPS_ACCESS_RIGHTS_TEST negative test (mps2 AN505) that
drives the guard with malformed ranges and asserts TEE_ERROR_ACCESS_DENIED.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments