Skip to content

pppd: Add checks to avoid out-of-bounds writes to static data#589

Open
paulusmack wants to merge 1 commit into
masterfrom
dev
Open

pppd: Add checks to avoid out-of-bounds writes to static data#589
paulusmack wants to merge 1 commit into
masterfrom
dev

Conversation

@paulusmack
Copy link
Copy Markdown
Collaborator

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.

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant