incubator-nuttx/sched/sched
EunBong Song 91aa26774b This patch prevent heap corruption as in below case.
TASK A                        TASK B
                              malloc()
                              mm_takesemaphore()
                              heap holder is set to TASK B
                         <--- preempt
...
task_exit()
Set to current task to
  TASK B
Try to release tcb, and
  stack memory
free()
mm_takesemaphore()
  - Successfully obtain
    semaphore because current
    task and heap holder is
    same.
Free memory....
Heap corrupt.

This change forces all de-allocations via sched_kfree() and sched_ufree()
to be delayed.  Eliminating the immediate de-allocation prevents the
above problem with the the re-entrant semaphore because the deallocation
always occurs on the worker thread, never on TASK B.

There could be consequences in the timing of memory availability.  We
will see.
2018-09-11 08:17:33 -06:00
..
Make.defs This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT. 2018-08-30 10:27:18 -06:00
sched.h This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT. 2018-08-30 10:27:18 -06:00
sched_addblocked.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_addprioritized.c Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
sched_addreadytorun.c Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
sched_continue.c This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT. 2018-08-30 10:27:18 -06:00
sched_cpuload.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_cpuload_oneshot.c include/nuttx/clock.h, sched/sched: Support the CPU load measurement using timer_lowerhalf_s interface 2018-08-24 10:10:57 -06:00
sched_cpuload_period.c include/nuttx/clock.h, sched/sched: Support the CPU load measurement using timer_lowerhalf_s interface 2018-08-24 10:10:57 -06:00
sched_cpupause.c sched_note: Extend OS instrumentation to include some SMP events. 2016-11-27 17:14:57 -06:00
sched_cpuselect.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_foreach.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_free.c This patch prevent heap corruption as in below case. 2018-09-11 08:17:33 -06:00
sched_garbage.c Squashed commit of the following: 2018-08-24 08:30:01 -06:00
sched_getaffinity.c sched/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). Add new nxsched_setscheduler() and nxsched_getaffinity() which are equivalent to their counterparts without the nx on front. These versions do not modify the errno value. Changed all calls within the OS to use these newer versions of the functions. 2018-01-30 16:16:41 -06:00
sched_getfiles.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_getparam.c Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t 2018-06-16 12:16:13 -06:00
sched_getscheduler.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_getsockets.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_getstreams.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_gettcb.c Implement sched_setaffinity() and sched_getaffinity() 2016-02-19 19:18:54 -06:00
sched_idletask.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_lock.c sched/sched: sched_lock() and sched_unlock().. back out some changes I made recently. The seemed correct but apparently not. Also reorder to logic so that g_global_lockcount is incremented for the very minimum amount of time. 2018-02-06 13:49:21 -06:00
sched_lockcount.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_mergepending.c Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
sched_mergeprioritized.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_note.c SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note() 2018-01-17 13:29:42 +09:00
sched_processtimer.c Change ordering of round-robin time slice check (sched_process_scheduler()) and processing of wdog timers (wd_timer()). wd_timer()'s callback function can change current running task and, hence, must be done after the time slice check. 2018-04-13 07:38:15 -06:00
sched_releasetcb.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
sched_removeblocked.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_removereadytorun.c Merged in masayuki2009/nuttx.nuttx/fix_smp_bugs (pull request #615) 2018-03-20 12:34:38 +00:00
sched_reprioritize.c Remove trailing spaces at the end of lines. 2018-08-13 07:39:38 -06:00
sched_resumescheduler.c SMP: Introduce a new global IRQ clearing logic and tasklist protection. 2018-01-31 15:35:36 +09:00
sched_roundrobin.c sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
sched_rrgetinterval.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_self.c sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro 2016-02-06 17:44:41 -06:00
sched_setaffinity.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_setparam.c Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t 2018-06-16 12:16:13 -06:00
sched_setpriority.c Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
sched_setscheduler.c Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t 2018-06-16 12:16:13 -06:00
sched_sporadic.c Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t 2018-06-16 12:16:13 -06:00
sched_suspend.c This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT. 2018-08-30 10:27:18 -06:00
sched_suspendscheduler.c Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
sched_tasklistlock.c Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
sched_thistask.c Merged in masayuki2009/nuttx.nuttx/change_copyright (pull request #621) 2018-04-04 12:35:47 +00:00
sched_timerexpiration.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
sched_unlock.c sched/sched: sched_lock() and sched_unlock().. back out some changes I made recently. The seemed correct but apparently not. Also reorder to logic so that g_global_lockcount is incremented for the very minimum amount of time. 2018-02-06 13:49:21 -06:00
sched_verifytcb.c Update some comments. 2017-09-11 14:27:02 -06:00
sched_wait.c Miscellaneous fixes from astyle tool. 2017-08-14 17:19:27 -06:00
sched_waitid.c Squashed commit of the following: 2017-10-07 08:22:18 -06:00
sched_waitpid.c sched/sched/sched_waitpid.c: Remove a bad error check. I though Juha already removed this problem. Did I lose his change? 2018-09-10 06:57:12 -06:00
sched_yield.c Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00