optee with rpmb error 0xffff0007 TEE_ERROR_BAD_DATA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

optee with rpmb error 0xffff0007 TEE_ERROR_BAD_DATA

Jump to solution
350 Views
CrazyDeveloper
Contributor III

I am Working on Optee in imx8mm device and xtests and other applications were working fine. However, then I enabled the following flags in Optee-os


```
EXTRA_OEMAKE:append = " \

CFG_RPMB_FS=y \

CFG_RPMB_WRITE_KEY=y \

CFG_RPMB_FS_DEV_ID=0 \

CFG_RPMB_TESTKEY=y \

CFG_REE_FS=y \

"
```

and added the` RPMB_EMU=0` in tee-supplicant/Makefile in optee-client but after doing these changes, all my tests are failing


```
* regression_1004 Test User Crypt TA
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:459: xtest_teec_open_session( &session, &crypt_user_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1004 FAILED

* regression_1005 Many sessions
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:551: xtest_teec_open_session(&sessions[i], &concurrent_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1005 FAILED

* regression_1006 Test Basic OS features
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:570: xtest_teec_open_session(&session, &os_test_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1006 FAILED

* regression_1007 Test Panic
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:594: xtest_teec_open_session(&session, &os_test_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1007 FAILED

* regression_1008 TEE internal client API
o regression_1008.1 Invoke command
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:738: xtest_teec_open_session(&session, &os_test_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1008.1 FAILED
o regression_1008.2 Invoke command with timeout
/usr/src/debug/optee-test/3.19.0.imx-r0/git/host/xtest/regression_1000.c:759: xtest_teec_open_session(&session, &os_test_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff0007 = TEEC_ERROR_BAD_STATE, expected 0x0 = TEEC_SUCCESS
regression_1008.2 FAILED
o regression_1008.3 Create session fail
n = 0
```

Note:
I am using optee_os_3.19 version right now. I have not touched the emmc rpmb before. I even removed the `CFG_REE_FS=y` flag but it still gave the same results

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
298 Views
CrazyDeveloper
Contributor III

Hi! I am already running as sudo user. Here I have gone to more details and found some reason for error.

I dry run the optee code (I can't see optee logs due to some reason ) and I found out the error was coming from here. I just wanna ask that I just want to fuse the testkey, what it has to do with HW Unique key and which flags I need further to write the test key on rpmb. Should I need to Fuse OTP necessarily?
 
CrazyDeveloper_1-1722594986701.png

 

 
 
 For security reasons, we don't allow writing the RPMB key using the  development HUK even though it is unique.
 
 
CrazyDeveloper_0-1722594943846.png

 

 

 

View solution in original post

0 Kudos
Reply
3 Replies
315 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Please make sure to run tee-supplicant with sudo before running the test.

https://github.com/OP-TEE/optee_os/issues/865#issuecomment-228551328

Best regards/Saludos,
Aldo.

0 Kudos
Reply
299 Views
CrazyDeveloper
Contributor III

Hi! I am already running as sudo user. Here I have gone to more details and found some reason for error.

I dry run the optee code (I can't see optee logs due to some reason ) and I found out the error was coming from here. I just wanna ask that I just want to fuse the testkey, what it has to do with HW Unique key and which flags I need further to write the test key on rpmb. Should I need to Fuse OTP necessarily?
 
CrazyDeveloper_1-1722594986701.png

 

 
 
 For security reasons, we don't allow writing the RPMB key using the  development HUK even though it is unique.
 
 
CrazyDeveloper_0-1722594943846.png

 

 

 

0 Kudos
Reply
287 Views
CrazyDeveloper
Contributor III

Sorry this function is called for IMX I guess, the other one is called for plat-zynqmp

CrazyDeveloper_0-1722595935006.png

 

0 Kudos
Reply