Skip to content
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

xtest 6016 why don't fs_open use TEE_DATA_FLAG_OVERWRITE #759

Open
XMPengYinjie opened this issue Oct 31, 2024 · 1 comment
Open

xtest 6016 why don't fs_open use TEE_DATA_FLAG_OVERWRITE #759

XMPengYinjie opened this issue Oct 31, 2024 · 1 comment

Comments

@XMPengYinjie
Copy link
Contributor

XMPengYinjie commented Oct 31, 2024

Hi, why xtest 6016 case don't use TEE_DATA_FLAG_OVERWRITE flag for fs_open after fs_create?

`static void *test_6016_thread(void *arg)
{
	struct test_6016_thread_arg *a = arg;
	TEEC_Session sess = a->session;
	uint32_t obj = 0;
	uint8_t out[10] = { };
	uint32_t count = 0;

	/* create */
	if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t,
		**fs_create(&sess, a->file_name, sizeof(a->file_name),
			  TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
			  sizeof(data_01), &obj, a->storage_id)))**
		goto exit;

	if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t, fs_close(&sess, obj)))
		goto exit;

	/* write new data */
	if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t,
		**fs_open(&sess, a->file_name, sizeof(a->file_name),
			TEE_DATA_FLAG_ACCESS_WRITE, &obj, a->storage_id)))**
		goto exit;
`

fs_open is aim to overwirte the raw data of obj from fs_create, so above fs_open will return TEE_ERROR_ACCESS_CONFLICT.

Now i have a issue in my test, i want to sure if the case codes are wrong.

Could you please help with my question? Thanks!

@jenswi-linaro
Copy link
Contributor

TEE_DATA_FLAG_OVERWRITE is not a valid flag for TEE_OpenPersistentObject().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants