signal: add signal number bound check#475
Open
etiaro wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces bounds checking for signal numbers in the raise, kill, killpg, and signalPostPosix functions to prevent out-of-bounds access to the internal signal mapping table. The review feedback correctly identifies that the current implementation incorrectly rejects signal 0, which is a valid 'null signal' used in POSIX for process and thread existence checks. It is recommended to update the lower bound check from sig <= 0 to sig < 0 across all modified functions to maintain standard behavior.
bf26779 to
3b1c190
Compare
adamgreloch
previously approved these changes
May 8, 2026
3ed62bc to
c3cb17f
Compare
14 tasks
adamgreloch
reviewed
May 13, 2026
Avoid Out Of Bounds accesses to static array _signals_posix2phx. JIRA: RTOS-1309
Process-wide sigmask that was set here was left unused in kernel. JIRA: RTOS-1309
Ensure no unexpected out-of-bounds errors will happen. JIRA: RTOS-1309
c3cb17f to
37508ed
Compare
adamgreloch
previously approved these changes
May 14, 2026
required by POSIX JIRA: RTOS-736
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Avoid Out Of Bounds accesses to static array _signals_posix2phx.
JIRA: RTOS-1309
Additional change with a signalHandle syscall signature adjustment: not marked as breaking, as missing arguments can still be obtained from stack garbage in kernel, as their resulting values were unused anyway.
Motivation and Context
Resolves phoenix-rtos/phoenix-rtos-project#1453
Types of changes
How Has This Been Tested?
Checklist:
Special treatment