mirror of
https://github.com/apache/nuttx.git
synced 2026-08-14 17:03:29 +00:00
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> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| group.h | ||
| group_childstatus.c | ||
| group_continue.c | ||
| group_create.c | ||
| group_foreachchild.c | ||
| group_free.c | ||
| group_getegid.c | ||
| group_geteuid.c | ||
| group_getgid.c | ||
| group_getuid.c | ||
| group_join.c | ||
| group_killchildren.c | ||
| group_leave.c | ||
| group_malloc.c | ||
| group_realloc.c | ||
| group_setegid.c | ||
| group_seteuid.c | ||
| group_setgid.c | ||
| group_setuid.c | ||
| group_setupidlefiles.c | ||
| group_setuptaskfiles.c | ||
| group_signal.c | ||
| group_suspendchildren.c | ||
| group_waiter.c | ||
| group_zalloc.c | ||
| Make.defs | ||