nuttx/sched/group
wangyongrong f20f9ff19e sched/group: skip group_release for kernel thread group
When CONFIG_DISABLE_PTHREAD=y, HAVE_GROUP_MEMBERS is undefined and
group_leave() unconditionally calls group_release() for every exiting
thread. This destroys the shared g_kthread_group resources (mutex,
fdlist, task_info) while other kernel threads are still using them,
causing use-after-free crashes.

Fix by checking TCB_FLAG_TTYPE_KERNEL in group_leave() before calling
group_release(), so the entire release path is skipped for kernel
threads. This is safe because g_kthread_group is statically allocated
and its lifetime is the entire system.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2026-05-08 13:44:51 +08:00
..
CMakeLists.txt binfmt: refactor loadable module cleanup mechanism 2026-01-18 08:30:15 -03:00
group.h sched:use tcb inside of pthread_tcb_s, remove all cast 2025-12-22 17:55:45 +08:00
group_childstatus.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
group_continue.c sched: After nxsched_add_readytorun, change first parameter to up_switch_context to this_task() 2025-08-20 10:16:43 +08:00
group_create.c fs/inode: add optional manual FD backtrace control via task group flag 2026-04-28 09:53:27 +02:00
group_foreachchild.c sched/group_foreachchild.c: fix warning 2026-03-24 10:56:23 -03:00
group_free.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_getegid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_geteuid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_getgid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_getuid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_join.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
group_killchildren.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
group_leave.c sched/group: skip group_release for kernel thread group 2026-05-08 13:44:51 +08:00
group_malloc.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_realloc.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_setegid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_seteuid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_setgid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_setuid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_setupidlefiles.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
group_setuptaskfiles.c sched:use tcb_s inside of task_tcb_s , remove all cast 2025-12-22 17:55:45 +08:00
group_signal.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
group_suspendchildren.c sched/group: There is no need to use sched_[un]lock 2024-10-09 13:46:33 +08:00
group_waiter.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
group_zalloc.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
Make.defs binfmt: refactor loadable module cleanup mechanism 2026-01-18 08:30:15 -03:00