Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/pthread_cancelpt: Fix nxtask_delete from another task group #11241

Merged
merged 1 commit into from Nov 22, 2023

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented Nov 21, 2023

Summary

PR #11165 causes an unnecessary regression; task_delete no longer works, if the deleted task is from another group.

The logic that prevents this comes from:

nxnotify_cancellation() ->
tls_get_info_pid() ->
nxsched_get_stackinfo()

Which checks for permissions, which does not make sense in this case since it is the kernel asking for the stack information.

Fix this by partially reverting 11165 and implementing a direct path for the kernel to query for any tasks TLS.

Impact

Fix the regression

Testing

rv-virt:nsh64 + ostest, test task_delete

@pussuw pussuw changed the title task/pthread_cancelpt: Fix task_delete from another task group task/pthread_cancelpt: Fix nxtask_delete from another task group Nov 21, 2023
include/nuttx/sched.h Outdated Show resolved Hide resolved
sched/sched/sched_get_tls.c Outdated Show resolved Hide resolved
PR apache#11165 causes an unnecessary regression; task_delete no longer works,
if the deleted task is from another group.

The logic that prevents this comes from:

nxnotify_cancellation() ->
tls_get_info_pid() ->
nxsched_get_stackinfo()

Which checks for permissions, which does not make sense in this case since
it is the kernel asking for the stack information.

Fix this by partially reverting 11165 and implementing a direct path for
the kernel to query for any tasks TLS.
@xiaoxiang781216 xiaoxiang781216 merged commit 57de648 into apache:master Nov 22, 2023
26 checks passed
@xiaoxiang781216 xiaoxiang781216 linked an issue Nov 23, 2023 that may be closed by this pull request
@jerpelea jerpelea added this to To-Add in Release Notes - 12.4.0 Dec 27, 2023
@jerpelea jerpelea moved this from To-Add to core in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from core to processed in Release Notes - 12.4.0 Jan 8, 2024
@pussuw pussuw deleted the fix_cancelpt_regression branch February 8, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Fail to nxtask_delete by update of cancel point logic
4 participants