Code Protection for AURIX TriCore

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
AlTi
Newbie
Posts: 40
Joined: Thu Jun 25, 2015 9:52 am

Code Protection for AURIX TriCore

Post by AlTi » Wed Jul 22, 2015 9:15 am

Hi,

in AUTOSAR (sws_os_00027) code protection is optional and in ERIKA 2.5.0 it is not implemented yet (all code is executable).
I have seen now a "todo" for the code protection in 'ee_tc_mem_time_prot.c'. Do you have concrete plans to implement code protection in the near future or does it have a low priority?

Thanks,
AlTi

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Code Protection for AURIX TriCore

Post by paolo.gai » Wed Jul 22, 2015 9:21 am

Nobody currently asked us about code protection. But if you are interested we could work on that too.

Note that this topic goes out of the forum... please write a mail about that to the commercial support at info@evidence.eu.com ... thanks!

Paolo

AlTi
Newbie
Posts: 40
Joined: Thu Jun 25, 2015 9:52 am

Re: Code Protection for AURIX TriCore

Post by AlTi » Wed Jul 22, 2015 12:07 pm

thank you for your reply. I´m currently not interested in commercial support, because I am working with ERIKA in a non-commercial domain. I´m writing a master thesis about TriCore´s safety features and therefore it would be nice to have a demonstrator that utilizes the code protection of the TriCore. So if I have correctly understood you, there will be no code protection until a commercial partner will request it (and the changes are merged back into the free version of erika) or someone freely contributes code protection.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Code Protection for AURIX TriCore

Post by paolo.gai » Wed Jul 22, 2015 1:05 pm

Exactly... feel free to conribute the code protection mechanism, and we'll do what we can to merge it back into mainline.

Ciao,

PJ

AlTi
Newbie
Posts: 40
Joined: Thu Jun 25, 2015 9:52 am

Re: Code Protection for AURIX TriCore

Post by AlTi » Mon Aug 10, 2015 11:55 am

I´m currently experimenting with the code protection. I have seen in Debug/tc27x_multicore.map, that there are a lot of "EE"_functions in the section .CPU0.text. Is this mapping intended or necessary for the current implementation? If not, I would place all "EE"-code from .CPUx.text into the private kernel section to have a clear seperation between Kernel code and non-kernel-code.

Here is a part of the map-file:

Code: Select all

[b]0x8002741e 0x8002743d   32 l EE_thread_not_terminated                   PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x8002743e 0x8002743f    2 l EE_oo_notify_error_from_us_internal        PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027440 0x800274ed  174 l EE_rq2stk_exchange                         PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x800274ee 0x80027587  154 l EE_rq_insert                               PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027588 0x800275db   84 l EE_rq_queryfirst                           PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x800275dc 0x800276eb  272 l EE_oo_ChainTask                            PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x800276ec 0x800277b9  206 l EE_oo_GetResource                          PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x800277ba 0x80027963  426 l EE_oo_ReleaseResource                      PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027964 0x800279d1  110 l EE_oo_release_all_resources                PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x800279d2 0x80027a2d   92 l EE_oo_ClearEvent                           PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027a2e 0x80027aef  194 l EE_oo_GetEvent                             PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027af0 0x80027c9f  432 l EE_oo_SetEvent                             PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027ca0 0x80027e6f  464 l EE_oo_WaitEvent                            PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027e70 0x80027fbd  334 l EE_tc_enable_protections                   PMU_PFLASH0 .CPU0.text                         .CPU0.text          [/b]               master/myProject_master.elf
0x80027fbe 0x80027fcd   16 l _exit                                      PMU_PFLASH0 .CPU0.text                         .CPU0.text                         master/myProject_master.elf
0x80027fd0 0x80027fd9   10 l CallTrustedService_GetVar_CPU0             PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  master/myProject_master.elf
0x80027fd0 0x80027fd0    0 g ee_sapi_code_CPU0_                         PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  tc27x_multicore.elf
0x80027fda 0x80027fed   20 l CallTrustedService_SetVar_CPU0             PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  master/myProject_master.elf
0x80027fee 0x80028001   20 l CallTrustedService_test_assert_CPU0        PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  master/myProject_master.elf
0x80028002 0x8002800b   10 l CallTrustedService_Write_0                 PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  master/myProject_master.elf
0x8002800c 0x80028065   90 l EnableAllInterrupts                        PMU_PFLASH0 .CPU0.ee_api_text                  .CPU0.ee_api_text                  master/myProject_master.elf

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Code Protection for AURIX TriCore

Post by paolo.gai » Mon Aug 10, 2015 5:09 pm

For sure the EE_* functions are the kernel code... But I'm not sure you need the separation in thes ections between Kernel and non-kernel code...

Ciao,

PJ

AlTi
Newbie
Posts: 40
Joined: Thu Jun 25, 2015 9:52 am

Re: Code Protection for AURIX TriCore

Post by AlTi » Tue Aug 11, 2015 7:59 am

It could be helpful if I want to protect the kernel code from being directly executed by OS-Applications.

Regards,
Alex

Post Reply