OP-TEE / optee_os

Trusted side of the TEE
Other
1.51k stars 1.03k forks source link

CSD locking issue #6893

Open sungkeunsong opened 2 weeks ago

sungkeunsong commented 2 weeks ago

Hi experts,

I got CSD locking issue. The Issue occures when suspending and resuming repeatedly. The call stack is as follows.

[2024-06-11 12:46:36.163] [ 145.080166] Task dump for CPU 1: [2024-06-11 12:46:36.163] [ 145.080567] task:gateway state:R running task stack: 0 pid: 984 ppid: 939 flags:0x00000a02 [2024-06-11 12:46:36.163] [ 145.081726] Call trace: [2024-06-11 12:46:36.163] [ 145.082020] __switch_to+0xc8/0x120 [2024-06-11 12:46:36.163] [ 145.082432] prep_new_page+0x70/0xa0 [2024-06-11 12:46:36.166] [ 145.082853] get_page_from_freelist+0x1138/0x1490 [2024-06-11 12:46:36.166] [ 145.083406] trace_lock_acquire+0x174/0x204 [2024-06-11 12:46:36.166] [ 145.083896] lock_acquire+0x3c/0x8c [2024-06-11 12:46:36.166] [ 145.084307] 0xffffb01a578a2c00 [2024-06-11 12:46:36.166] [ 145.084716] mutex_unlock+0x2c/0x50 [2024-06-11 12:46:36.167] [ 145.085130] optee_do_call_with_arg+0xe4/0x1e4 [2024-06-11 12:46:36.167] [ 145.085650] optee_invoke_func+0x138/0x1b0 [2024-06-11 12:46:36.167] [ 145.086130] tee_ioctl+0x1524/0x1630 [2024-06-11 12:46:36.167] [ 145.086553] __arm64_sys_ioctl+0xa8/0xf0 [2024-06-11 12:46:36.167] [ 145.087016] el0_svc_common.constprop.0+0x7c/0x1d0 [2024-06-11 12:46:36.169] [ 145.087578] do_el0_svc+0x28/0x94 [2024-06-11 12:46:36.169] [ 145.087969] el0_svc+0x20/0x30 [2024-06-11 12:46:36.169] [ 145.088329] el0_sync_handler+0xa4/0x130 [2024-06-11 12:46:36.171] [ 145.088805] el0_sync+0x184/0x1c0 [2024-06-11 12:46:36.171] [ 145.089197] smp: csd: Re-sending CSD lock (#1) IPI from CPU#00 to CPU#01 [2024-06-11 12:46:36.171] [ 145.089983] CPU: 0 PID: 599 Comm: TimeManager Tainted: G O 5.10.153-g0aa6ece4c3e6 #1

I 'm using OPTEE 3.19. I don't have logs of TA and OPTEE. I want to know why the TA is not responding.

Thank you

sungkeunsong commented 5 days ago

I found out the the root cause. This issue occurs by the known RNS issue (https://github.com/OP-TEE/optee_os/commit/5c4a6d1b68ca5a1656fcdeee1f92fa6d4f212879)

Thanks