nuttx/sched/task
ligd 416f28b499 sched/task: skip uninitialized TCB in nxtask_argvstr
When pthread_create adds a TCB to g_pidhash via nxtask_assign_pid(),
the TCB becomes visible to other threads before its flags and stack
are fully initialized. If ps command reads this TCB during the race
window, nxtask_argvstr() may access uninitialized stack data
(0xdeadbeef from stack coloration) and crash in strmlen().

Add task_state == TSTATE_TASK_INVALID check to nxtask_argvstr() to
skip TCBs that have not been fully initialized yet.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 01:35:59 +08:00
..
CMakeLists.txt inline nxsched_getpid 2026-04-21 01:32:10 +08:00
Make.defs inline nxsched_getpid 2026-04-21 01:32:10 +08:00
exit.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
spawn.h sched: migrate to SPDX identifier 2026-04-21 00:59:40 +08:00
task.h include/sched.h: remove implicit type conversions 2026-04-21 01:28:21 +08:00
task_activate.c fixtypo: fix the typo 2026-04-21 01:29:10 +08:00
task_argvstr.c sched/task: skip uninitialized TCB in nxtask_argvstr 2026-04-21 01:35:59 +08:00
task_cancelpt.c sched/task: refine the workflow for asynchronous cancellation 2026-04-21 01:34:47 +08:00
task_create.c misra_c_10_4: fix violation essential type operand of unsigned and signed 2026-04-21 01:29:24 +08:00
task_delete.c task_delete.c: coverity HIS_metric_violation: RETURN 2026-04-21 01:28:06 +08:00
task_execve.c sched: migrate to SPDX identifier 2026-04-21 00:59:40 +08:00
task_exit.c sched: unify the thread exit running task behavior. 2026-04-21 01:35:42 +08:00
task_exithook.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
task_fork.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
task_getppid.c task: coverity HIS_metric_violation: RETURN 2026-04-21 01:28:18 +08:00
task_init.c sched/atomic: fix the param defined but not use atomic API. 2026-04-21 01:35:58 +08:00
task_join.c Merge branch 'master' into vela 2026-04-21 01:12:27 +08:00
task_posixspawn.c Revert "libs/libc: Put posix_spawn into libc" 2026-04-21 01:32:17 +08:00
task_prctl.c task_prctl.c: coverity HIS_metric_violation: GOTO 2026-04-21 01:28:07 +08:00
task_recover.c sched/wdog: Remove wd_recover. 2026-04-21 01:28:59 +08:00
task_reparent.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
task_restart.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
task_setup.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00
task_spawn.c task_spawn.c: coverity HIS_metric_violation: RETURN 2026-04-21 01:28:08 +08:00
task_spawnparms.c misra_c_10_4_violation: change priorit/policy to int type 2026-04-21 01:29:21 +08:00
task_start.c sched/atomic: fix the param defined but not use atomic API. 2026-04-21 01:35:58 +08:00
task_terminate.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-04-21 01:35:40 +08:00