pppd: Add checks to avoid out-of-bounds writes to static data#589
Open
paulusmack wants to merge 1 commit into
Open
pppd: Add checks to avoid out-of-bounds writes to static data#589paulusmack wants to merge 1 commit into
paulusmack wants to merge 1 commit into
Conversation
…tpacket_buf In ipcp_reqci(), there is code that appends a CI_ADDR option to the list of options being returned as a Configure-Nak. Add a check to this code to ensure that there is sufficient space to append the option, so that a malicious peer can't cause the code to write past the end of inpacket_buf (which is what 'inp' points to). In fsm_sdata(), the code that trims the length of the outgoing packet to the peer's MRU could potentially result in the length being greater than 1500, causing the following code to write beyond the end of the outpacket_buf array if the peer has negotiated an MRU larger than 1500. To prevent this, limit the length to 1500 or the peer's MRU, whichever is smaller. These issues were found by Sebastian Eisenreich-Dietz (CyberDanube) in cooperation with A&R TECH. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
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.
Add checks to avoid out-of-bounds writes to inpacket_buf and outtpacket_buf, which are both statically allocated arrays.
In ipcp_reqci(), there is code that appends a CI_ADDR option to the list of options being returned as a Configure-Nak. Add a check to this code to ensure that there is sufficient space to append the option, so that a malicious peer can't cause the code to write past the end of inpacket_buf (which is what 'inp' points to).
In fsm_sdata(), the code that trims the length of the outgoing packet to the peer's MRU could potentially result in the length being greater than 1500, causing the following code to write beyond the end of the outpacket_buf array if the peer has negotiated an MRU larger than
1500. To prevent this, limit the length to 1500 or the peer's MRU, whichever is smaller.
These issues were found by Sebastian Eisenreich-Dietz (CyberDanube) in cooperation with A&R TECH.