[kernel] Fix medium-model signal handler range#2748
Closed
parabyte wants to merge 1 commit into
Closed
Conversation
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.
Summary
This fixes
sys_signal()validation for medium-model executables whose combined code allocation crosses 64 KiB.The current check converts the allocation from paragraphs to bytes with
s->size << 4. That 16-bit expression wraps at 64 KiB, and requiring the handler segment to equal the allocation base also rejects valid far-text handlers.The replacement:
The byte offset is converted with four single-bit 8086 shifts, avoiding a division helper or variable-count shift.
Validation
Validated at commit
548d73db1fc57f4f11c7e7379f87461077ca23ebon upstream masterb7cfe4973487ab235169dd9eb489285409fb8b2a:ibmpc-1440kernel build: passsys_signaldisassembly: 16-bit 8086 instructions onlyRelated signal audit discussions: #2646 and #2649.