Commit Graph
1 Commits
Author SHA1 Message Date
tardigradeandFrédéric Desbiens 29afcc3946 Fixed a kernel stack leak when deleting user-mode module threads (#692)
* modules: free kernel stack on thread deletion

Signed-off-by: Prashit Vora <prashitvora2006@gmail.com>

* Preserved the thread object release when the kernel stack cannot be freed

Releasing the kernel stack ahead of the thread object made a failure of the kernel
stack deallocation abort the thread object release. The thread had already been
deleted at that point, so the thread object would have stayed allocated for the
lifetime of the module.

The thread object is now always released once the delete succeeds, and the kernel
stack failure is reported only when it does not mask a thread object failure.



---------

Signed-off-by: Prashit Vora <prashitvora2006@gmail.com>
Co-authored-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
Assisted-by: Copilot (Opus 5) <noreply@github.com>
2026-09-08 11:17:57 -04:00