Skip to content

Commit

Permalink
Initialize optee SMC arguments memory as zero
Browse files Browse the repository at this point in the history
Fix possible wrong communication between REE and TEE.

Test done:
1. Fastboot flash OK
2. adb reboot OK

Tracked-On: OAM-114239
Signed-off-by: Jingdong Lu <[email protected]>
  • Loading branch information
jingdlu authored and sysopenci committed Dec 20, 2023
1 parent ba4fb03 commit b0f94b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tee/optee/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ static void optee_smccc_smc(unsigned long a0, unsigned long a1,
g_smc_args[index].a5 = a5;
g_smc_args[index].a6 = a6;
g_smc_args[index].a7 = a7;
g_smc_args[index].a8 = 0x0;

spin_lock(&smc_ring_lock);
g_smc_used_ring->ring[g_smc_used_ring->tail] = index;
Expand Down Expand Up @@ -1324,6 +1325,7 @@ static int ivshmem_probe(struct pci_dev *pdev, const struct pci_device_id *id)
for (i = 0; i < OPTEE_SHM_QUEUE_SIZE; i++) {
g_smc_used_ring->ring[i] = OPTEE_SHM_QUEUE_SIZE;
}
memset(g_smc_args, 0, sizeof(struct optee_smc_args) * OPTEE_SHM_QUEUE_SIZE);

g_ivshmem_dev.dev = pdev;

Expand Down

0 comments on commit b0f94b1

Please sign in to comment.