You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/11/08 20:19:25 UTC

[GitHub] [mynewt-core] kasjer commented on pull request #2716: util: Add sensitive data mynewt util to hide data in coredumps

kasjer commented on pull request #2716:
URL: https://github.com/apache/mynewt-core/pull/2716#issuecomment-963538849


   > @kasjer We have been speaking about this and it was my suggestion to look at defining sections instead of adding more code for protected data so that we could generically define data structures and variables in a specified section. It seems to be the best way to make it user friendly. `dump_cfg` is also good. Though it is little weird to define variables in a region that is not present in `dump_cfg`. Do you know of an easy to way to do that ?
   
   Considering that you already wanted to add one special section for sensitive data that should not go to core dump
   having such function in bsp does what you want with same changes to linker scripts.
   ```c
   const struct hal_bsp_mem_dump *
   hal_bsp_core_dump(int *area_cnt)
   {
       dump_cfg[0].hbmd_start = &_ram_start;
       dump_cfg[0].hbmd_size = (int)&__mynewt_protected_start - (int)&_ram_start;
       dump_cfg[1].hbmd_start = &__mynewt_protected_end;
       dump_cfg[1].hbmd_size = (int)&_ram_start + RAM_SIZE - (int)&__mynewt_protected_end;
   
       *area_cnt = 2;
       return dump_cfg;
   }
   ```
   I think some of the reviewers already use such approach and they may have some more insight.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org