-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: REE fs Secure storage #1800
Comments
@jenswi-linaro These issues may be caused by EMMC device which not work well. |
#1801 should fix the assert |
@jenswi-linaro , Code: static void put_dirh_primitive(bool close)
{
assert(ree_fs_dirh_refcount);
assert(ree_fs_dirh);
/*
* During the execution of one of the ree_fs_ops ree_fs_dirh is
* guareteed to be a valid pointer. But when the fop has returned
* another thread may get an error or something causing that fop
* to do a put with close=1.
*
* For all fops but ree_fs_close() there's a call to get_dirh() to
* get a new dirh which will open it again if it was closed before.
* But in the ree_fs_close() case there's no call to get_dirh()
* only to this function, put_dirh_primitive(), and in this case
* ree_fs_dirh may actually be NULL.
*/
ree_fs_dirh_refcount--;
if (ree_fs_dirh && (!ree_fs_dirh_refcount || close)) {
EMSG("____________ree_fs_dirh_refcount[%d]\n", ree_fs_dirh_refcount);
close_dirh(&ree_fs_dirh);
} LOG:
|
The line
was removed in #1801 |
Sorry, I have made the misstake, Thanks for your reply |
optee version 2.5
CFG_RPMB_FS=y has been set, and RPMB_EMU := 0 in tee-supplicant.
When run xtest 6016, sometimes failed.
It seem there are two issue in REE FS secure storage.
The get_dirh() and put_dirh() may not work well, please help to check.
ERROR: [0x2] TEE-CORE:put_dirh_primitive:555: ree_fs_dirh_refcount[0x4] ree_fs_dirh[0x7e334c18]
DEBUG: [0x2] TEE-CORE:__wq_rpc:62: wake thread 0 0x7e104dc0 -3
DEBUG: [0x2] TEE-CORE:__wq_rpc:62: sleep thread 2 0x7e104dc0 0
DEBUG: [0x0] TEE-CORE:__wq_rpc:62: wake thread 3 0x7e104dc0 -3
DEBUG: [0x3] TEE-CORE:__wq_rpc:62: sleep thread 3 0x7e104dc0 0
DEBUG: [0x0] TEE-CORE:__wq_rpc:62: wake thread 1 0x7e104dc0 -3
ERROR: [0x1] TEE-CORE:put_dirh_primitive:555: ree_fs_dirh_refcount[0x4] ree_fs_dirh[0x7e334c18]
*DEBUG: [0x0] TEE-CORE:__wq_rpc:62: sleep thread 0 0x7e104dc0 1
*DEBUG: [0x1] TEE-CORE:__wq_rpc:62: wake thread 2 0x7e104dc0 -3
ERROR: [0x2] TEE-CORE:put_dirh_primitive:555: ree_fs_dirh_refcount[0x3] ree_fs_dirh[0x7e334c18]
*DEBUG: [0x1] TEE-CORE:__wq_rpc:62: sleep thread 1 0x7e104dc0 2
*DEBUG: [0x2] TEE-CORE:__wq_rpc:62: wake thread 3 0x7e104dc0 -3
DEBUG: [0x2] TEE-CORE:__wq_rpc:62: sleep thread 2 0x7e104dc0 3
DEBUG: [0x3] TEE-CORE:dump_fh:1647: fh->filename=/dirfile.db.hash
DEBUG: [0x3] TEE-CORE:dump_fh:1648: fh->rpmb_fat_address=512
DEBUG: [0x3] TEE-CORE:dump_fh:1649: fh->fat_entry.start_address=4193792
DEBUG: [0x3] TEE-CORE:dump_fh:1650: fh->fat_entry.data_size=32
DEBUG: [0x3] TEE-CORE:read_fat:1842: fat_address 512
DEBUG: [0x3] TEE-CORE:tee_rpmb_read:1323: Read 8 blocks at index 2
DEBUG: [0x3] TEE-CORE:rpmb_fs_write_primitive:2154: Updating data in-place
DEBUG: [0x3] TEE-CORE:tee_rpmb_read:1323: Read 1 block at index 16382
DEBUG: [0x3] TEE-CORE:tee_fs_crypt_block:316: Decrypt block #16382
DEBUG: [0x3] TEE-CORE:tee_rpmb_write_blk:1373: Write 1 block at index 16382
DEBUG: [0x3] TEE-CORE:tee_fs_crypt_block:316: Encrypt block #16382
ERROR: [0x3] TEE-CORE:put_dirh_primitive:555: ree_fs_dirh_refcount[0x3] ree_fs_dirh[0x7e334c18]
DEBUG: [0x3] TEE-CORE:__wq_rpc:62: wake thread 0 0x7e104dc0 -3
ERROR: [0x3] TEE-CORE:put_dirh_primitive:555: ree_fs_dirh_refcount[0x2] ree_fs_dirh[0x0]
*DEBUG: [0x0] TEE-CORE:__wq_rpc:62: sleep thread 0 0x7e104dc0 3
*ERROR: [0x3] TEE-CORE: assertion 'ree_fs_dirh' failed at core/tee/tee_ree_fs.c:557 <put_dirh_primitive>
ERROR: [0x3] TEE-CORE: Panic at core/kernel/assert.c:50 <_assert_break>
ERROR: [0x3] TEE-CORE: pc 0x7e006029
ERROR: [0x3] TEE-CORE: pc 0x7e00b6ab
ERROR: [0x3] TEE-CORE: pc 0x7e00ad73
ERROR: [0x3] TEE-CORE: pc 0x7e011af5
ERROR: [0x3] TEE-CORE: pc 0x7e011bb9
ERROR: [0x3] TEE-CORE: pc 0x7e0aa511
ERROR: [0x3] TEE-CORE: pc 0x7e00f531
ERROR: [0x3] TEE-CORE: pc 0x7e008d60
TEEC_ERROR_ACCESS_CONFLICT. It may be relate to dirfile.db.hash. Please help to review the code about dirf.db and dirfile.db.hash. What will happen when write dirf.db or dirfile.db.hash power down.
DEBUG: [0x0] TEE-CORE:tee_ta_init_pseudo_ta_session:259: Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (early TA)
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
DEBUG: [0x0] TEE-CORE:ta_load:317: ELF load address 0x101000
DEBUG: [0x0] TEE-CORE:tee_ta_init_pseudo_ta_session:259: Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (early TA)
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
DEBUG: [0x0] TEE-CORE:ta_load:317: ELF load address 0x101000
DEBUG: [0x0] TEE-CORE:tee_ta_init_pseudo_ta_session:259: Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (early TA)
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
DEBUG: [0x0] TEE-CORE:ta_load:317: ELF load address 0x101000
DEBUG: [0x0] TEE-CORE:tee_ta_init_pseudo_ta_session:259: Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (early TA)
DEBUG: [0x0] TEE-CORE:tee_ta_init_user_ta_session:632: Lookup user TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
DEBUG: [0x0] TEE-CORE:ta_load:317: ELF load address 0x101000
DEBUG: [0x1] TEE-CORE:__wq_rpc:62: sleep thread 1 0x7e104d8c 0
*DEBUG: [0x0] TEE-CORE:__wq_rpc:62: wake thread 1 0x7e104d8c -3
*DEBUG: [0x2] TEE-CORE:read_fat:1842: fat_address 0
*DEBUG: [0x0] TEE-CORE:tee_ta_invoke_command:625: Error: ffff0003 of 4
*DEBUG: [0x3] TEE-CORE:__wq_rpc:62: sleep thread 3 0x7e104d8c 0
/home/ljhui/work/hidessert/git/b030/Code/source/tee/core/optee/optee_test/host/xtest/regression_6000.c:1558: fs_create(&sess, a->file_name, sizeof(a->file_name), 0x00000002, 0, data_01, sizeof(data_01), &obj, a->storage_id) has an unexpected value: 0xffff0003 = TEEC_ERROR_ACCESS_CONFLICT, expected 0x0 = TEEC_SUCCESS
*DEBUG: [0x1] TEE-CORE:__wq_rpc:62: wake thread 3 0x7e104d8c -3
DEBUG: [0x1] TEE-CORE:__wq_rpc:62: sleep thread 1 0x7e104dc0 2
*DEBUG: [0x3] TEE-CORE:__wq_rpc:62: sleep thread 3 0x7e104dc0 2
*DEBUG: [0x2] TEE-CORE:tee_rpmb_read:1323: Read 8 blocks at index 2
DEBUG: [0x2] TEE-CORE:dump_fh:1647: fh->filename=/dirfile.db.hash
DEBUG: [0x2] TEE-CORE:dump_fh:1648: fh->rpmb_fat_address=512
DEBUG: [0x2] TEE-CORE:dump_fh:1649: fh->fat_entry.start_address=4193792
DEBUG: [0x2] TEE-CORE:dump_fh:1650: fh->fat_entry.data_size=32
DEBUG: [0x2] TEE-CORE:read_fat:1842: fat_address 512
DEBUG: [0x2] TEE-CORE:tee_rpmb_read:1323: Read 8 blocks at index 2
DEBUG: [0x2] TEE-CORE:tee_rpmb_read:1323: Read 1 block at index 16382
DEBUG: [0x2] TEE-CORE:tee_fs_crypt_block:316: Decrypt block #16382
DEBUG: [0x2] TEE-CORE:dump_fh:1647: fh->filename=/dirfile.db.hash
DEBUG: [0x2] TEE-CORE:dump_fh:1648: fh->rpmb_fat_address=512
DEBUG: [0x2] TEE-CORE:dump_fh:1649: fh->fat_entry.start_address=4193792
DEBUG: [0x2] TEE-CORE:dump_fh:1650: fh->fat_entry.data_size=32
DEBUG: [0x2] TEE-CORE:read_fat:1842: fat_address 512
DEBUG: [0x2] TEE-CORE:tee_rpmb_read:1323: Read 8 blocks at index 2
DEBUG: [0x2] TEE-CORE:rpmb_fs_write_primitive:2154: Updating data in-place
DEBUG: [0x2] TEE-CORE:tee_rpmb_read:1323: Read 1 block at index 16382
DEBUG: [0x2] TEE-CORE:tee_fs_crypt_block:316: Decrypt block #16382
DEBUG: [0x2] TEE-CORE:tee_rpmb_write_blk:1373: Write 1 block at index 16382
DEBUG: [0x2] TEE-CORE:tee_fs_crypt_block:316: Encrypt block #16382
DEBUG: [0x2] TEE-CORE:__wq_rpc:62: wake thread 1 0x7e104dc0 -3
DEBUG: [0x0] TEE-CORE:__wq_rpc:62: sleep thread 0 0x7e104dc0 1
DEBUG: [0x1] TEE-CORE:dump_fh:1647: fh->filename=/dirfile.db.hash
DEBUG: [0x1] TEE-CORE:dump_fh:1648: fh->rpmb_fat_address=512
DEBUG: [0x1] TEE-CORE:dump_fh:1649: fh->fat_entry.start_address=4193792
DEBUG: [0x1] TEE-CORE:dump_fh:1650: fh->fat_entry.data_size=32
DEBUG: [0x1] TEE-CORE:read_fat:1842: fat_address 512
DEBUG: [0x1] TEE-CORE:tee_rpmb_read:1323: Read 8 blocks at index 2
The text was updated successfully, but these errors were encountered: