incubator-nuttx/sched
Ville Juven c1ceec3404 sched/Kconfig: waitpid() depends on SCHED_HAVE_PARENT if BUILD_KERNEL
waitpid() cannot be used in kernel mode unless SCHED_HAVE_PARENT is
selected -> add dependency if BUILD_KERNEL is selected.

Why? Because without SCHED_HAVE_PARENT waitpid() works in a non-standard
way, meaning it does not use SIGCHLD to wake the parent, as it should.

Also, returning the child status via stat_loc corrupts memory as stat_loc
points to the parent's address environment:

pid_t nxsched_waitpid(pid_t pid, int *stat_loc, int options)
{
  ...
  group->tg_statloc = stat_loc;
  ...
}

And later when the status is returned, the child writes to tg_statloc,
which points to the parent's address environment -> random memory
corruption:

static inline void nxtask_exitwakeup(FAR struct tcb_s *tcb, int status)
{
  ...
  if (group->tg_statloc != NULL)
    {
      *group->tg_statloc = status << 8;
    }
  ...
}
2024-06-03 18:00:40 +02:00
..
addrenv cmake:complete missing changes during cmake reforming for sched 2023-09-08 21:20:16 +03:00
clock sched/group: change type of task group member to single queue 2024-03-07 12:39:29 +08:00
environ sched/environ: Improve performance of set/unset environment 2024-04-03 00:10:56 +08:00
group sched/group/group_killchildren.c: Force-cancel children if parent is force-cancelled 2024-03-20 18:03:15 -03:00
init sched/mqueue: merge System-V message queue initialize into posix 2024-03-26 17:32:11 +01:00
instrument sched/procfs:use instrument to statistics run time max stack 2023-12-11 02:06:51 -08:00
irq csection: We can save execution time by removing judgments. 2024-05-09 13:45:02 +08:00
misc fix nxstyle 2024-05-11 01:19:06 +08:00
module fs: procfs add poll support 2023-12-26 19:23:13 -08:00
mqueue sched/mqueue: reclaim message upon failure 2024-05-26 10:03:34 -03:00
paging sched/tasklist: replace task status list with macro definition 2024-03-21 11:23:46 +09:00
pthread sched/pthread: rename pthread_initialize.c as pthread_sem.c 2024-05-22 19:06:38 +08:00
sched sched: remove redundant variables "switched" 2024-05-21 09:00:29 +08:00
semaphore shced:sem: replace mutex with spinlock 2024-03-19 18:06:12 +08:00
signal sched/signal: add sanity check for siginfo 2024-03-26 20:55:04 +08:00
task sched/posixspawn: disable tedious logging 2024-05-10 15:40:34 +08:00
timer timer: use spin_lock_irqsave protect g_alloctimers 2024-04-11 10:45:34 +08:00
tls tls: fix build error under CONFIG_PTHREAD_ATFORK enabled 2024-05-28 13:54:30 +02:00
wdog clock: replace all up_perf_xx with perf_xx 2023-10-02 16:11:43 +02:00
wqueue sched: wqueue: Remove sched_[un]lock from kwork_inherit.c 2024-05-01 11:08:07 +08:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig sched/Kconfig: waitpid() depends on SCHED_HAVE_PARENT if BUILD_KERNEL 2024-06-03 18:00:40 +02:00
Makefile sched/procfs:use instrument to statistics run time max stack 2023-12-11 02:06:51 -08:00