Closed hallowsman closed 3 months ago
Hi @hallowsman,
If you want to use TEE_MALLOC_NO_SHARE
then you need to define the size of the "no share" malloc buffer in user_ta_header_defines.h
, because by default this size is zero (see https://github.com/OP-TEE/optee_os/commit/e64b7b2e2edc0cdf2e87cc30c4902e87db706f2f). For example:
#define TA_NO_SHARE_DATA_SIZE 1024
The other option is to remove TEE_MALLOC_NO_SHARE
in the TEE_Malloc()
call.
TEE_BigInt a; size_t len; len = (size_t)TEE_BigIntSizeInU32(1024); a = (TEE_BigInt)TEE_Malloc(len * sizeof(TEE_BigInt), TEE_MALLOC_NO_FILL | TEE_MALLOC_NO_SHARE); TEE_BigIntInit(a, len);
when i init TEE_BigInt like this,it panic and show like this:
D/TC:0 0 abort_handler:560 [abort] abort in User mode (TA will panic) E/TC:? 0 E/TC:? 0 User mode data-abort at address 0x0 (translation fault) E/TC:? 0 esr 0x92000045 ttbr0 0x400000e1c9000 ttbr1 0x00000000 cidr 0x0 E/TC:? 0 cpu #0 cpsr 0x20000100 E/TC:? 0 x0 0000000000000000 x1 0000000000000000 E/TC:? 0 x2 0000000000000088 x3 0000000000000000 E/TC:? 0 x4 0000000000000000 x5 00000000000003f2 E/TC:? 0 x6 000000008004ead8 x7 0000000080077710 E/TC:? 0 x8 00000000000003f2 x9 0000000000000065 E/TC:? 0 x10 0000000000000000 x11 0000000000000000 E/TC:? 0 x12 0000000000000000 x13 0000000080015f80 E/TC:? 0 x14 0000000000000000 x15 0000000000000000 E/TC:? 0 x16 0000000000000000 x17 0000000000000000 E/TC:? 0 x18 0000000000000000 x19 0000000000000022 E/TC:? 0 x20 0000000000000000 x21 000000008006b000 E/TC:? 0 x22 0000000080015f28 x23 00000000000003f2 E/TC:? 0 x24 0000000000000065 x25 0000000000000000 E/TC:? 0 x26 0000000000000000 x27 0000000000000000 E/TC:? 0 x28 0000000000000000 x29 0000000080015e00 E/TC:? 0 x30 00000000800538cc elr 0000000080063864 E/TC:? 0 sp_el0 0000000080015e00 E/LD: Status of TA d2aebf3f-705b-4aec-8286-64109e3e1acf E/LD: arch: aarch64 E/LD: region 0: va 0x80005000 pa 0x0e336000 size 0x002000 flags rw-s (ldelf) E/LD: region 1: va 0x80007000 pa 0x0e338000 size 0x008000 flags r-xs (ldelf) E/LD: region 2: va 0x8000f000 pa 0x0e340000 size 0x001000 flags rw-s (ldelf) E/LD: region 3: va 0x80010000 pa 0x0e341000 size 0x004000 flags rw-s (ldelf) E/LD: region 4: va 0x80014000 pa 0x0e345000 size 0x001000 flags r--s E/LD: region 5: va 0x80015000 pa 0x0e372000 size 0x001000 flags rw-s (stack) E/LD: region 6: va 0x80016000 pa 0x7f93fff8 size 0x002000 flags rw-- (param) E/LD: region 7: va 0x80018000 pa 0x44520000 size 0x001000 flags rw-- (param) E/LD: region 8: va 0x8004c000 pa 0x0e346000 size 0x01f000 flags r-xs [0] E/LD: region 9: va 0x8006b000 pa 0x0e365000 size 0x00d000 flags rw-s [0] E/LD: [0] d2aebf3f-705b-4aec-8286-64109e3e1acf @ 0x8004c000 E/LD: Call stack: E/LD: 0x80063864 E/LD: 0x8004e308 E/LD: 0x8004ecf8 E/LD: 0x8005be58 E/LD: 0x8005bc48 E/LD: 0x800509e4 D/TC:? 0 user_ta_enter:195 tee_user_ta_enter: TA panicked with code 0xdeadbeef