xtest storage: check that we can't use object_id from shared memory

According to the GP spec V1.1, the object_id in create/open/rename
functions is not allowed to reside in the shared memory.

This change checks that when a TA uses a SHM buffer to carry the
object_id parameter for create/open/rename function do rejects the
request. It is expected that the TA dies on such conditions.

Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
diff --git a/ta/storage/include/storage.h b/ta/storage/include/storage.h
index d4a4ddc..b0a1575 100644
--- a/ta/storage/include/storage.h
+++ b/ta/storage/include/storage.h
@@ -30,16 +30,20 @@
 
 #include <tee_api.h>
 
-TEE_Result ta_storage_cmd_open(uint32_t param_types, TEE_Param params[4]);
-TEE_Result ta_storage_cmd_create(uint32_t param_types, TEE_Param params[4]);
-TEE_Result ta_storage_cmd_create_overwrite(uint32_t param_types,
+TEE_Result ta_storage_cmd_open(uint32_t command, uint32_t param_types,
+						 TEE_Param params[4]);
+TEE_Result ta_storage_cmd_create(uint32_t command, uint32_t param_types,
+						   TEE_Param params[4]);
+TEE_Result ta_storage_cmd_create_overwrite(uint32_t command,
+					   uint32_t param_types,
 					   TEE_Param params[4]);
 TEE_Result ta_storage_cmd_close(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_read(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_write(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_seek(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_unlink(uint32_t param_types, TEE_Param params[4]);
-TEE_Result ta_storage_cmd_rename(uint32_t param_types, TEE_Param params[4]);
+TEE_Result ta_storage_cmd_rename(uint32_t command, uint32_t param_types,
+						   TEE_Param params[4]);
 TEE_Result ta_storage_cmd_trunc(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_alloc_enum(uint32_t param_types, TEE_Param params[4]);
 TEE_Result ta_storage_cmd_free_enum(uint32_t param_types, TEE_Param params[4]);