You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/03 23:24:38 UTC

[GitHub] [incubator-nuttx] patacongo opened a new pull request #964: sched/sched/sched_get_stackinfo.c: Add some security.

patacongo opened a new pull request #964:
URL: https://github.com/apache/incubator-nuttx/pull/964


   ## Summary
   
   The sched_get_stackinfo() interface was just added.  However, it occurs to me that it is a dangerous feature and could lead to security problems.  In FLAT and PROTECTED modes, if you get access to any other threads stack, you could do harm.
   
   This commit adds some level of security.  Basically, it implements these rules:
   
   1. Any thread may query its own stack,
   2. A kernel thread may query the stack of any other thread
   3. Application threads, however, may query only the stacks of threads within the same task group, i.e., the main thread and any of the child pthreads created with the main thread as a parent or grandparent or great-grandpart ...
   
   ## Impact
   
   If sched_get_stackinfo() is used properly, there should be no impact from this change.  sched_get_stackinfo() is the new underlying implementatino for the previously existing pthread_get_stackaddr_np() and pthread_get_stack_size_np().  Those, however, should only operate on application threads of the same task group and should not be affected if, again, they are used appropriately.
   
   ## Testing
   
   stm32f103-minimum:nsh
   
   
   


----------------------------------------------------------------
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.

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