task/task_cancelpt: Kill the child if it is not in a cancel point

Do not allow a deferred cancellation if the group is exiting, it is too
dangerous to allow the threads to execute any user space code after the
exit has started.

If the cancelled thread is not inside a cancellation point, just kill it
immediately via asynchronous cancellation. This will create far less
problems than allowing it to continue running user code.
This commit is contained in:
Ville Juven
2023-02-16 10:13:27 +02:00
committed by Xiang Xiao
parent 0e44666828
commit 2cdba4a0a2
3 changed files with 24 additions and 6 deletions
+1
View File
@@ -110,6 +110,7 @@
#define GROUP_FLAG_NOCLDWAIT (1 << 0) /* Bit 0: Do not retain child exit status */
#define GROUP_FLAG_PRIVILEGED (1 << 1) /* Bit 1: Group is privileged */
#define GROUP_FLAG_DELETED (1 << 2) /* Bit 2: Group has been deleted but not yet freed */
#define GROUP_FLAG_EXITING (1 << 3) /* Bit 3: Group exit is in progress */
/* Bits 3-7: Available */
/* Values for struct child_status_s ch_flags */