forked from richardcochran/linuxptp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that TLV length is correct when receiving TLVs.
The function, tlv_post_recv, and the functions it calls don't check the length of the tlv before flipping the byte order of fields. An attacker (or a really buggy client) can craft a message causing the byte order of data outside the received message to be flipped. None of the supported tlvs are large enough to flip bytes outside the ptp_message struct, which could corrupt the heap. However, it's easy to mess up the message's refcnt field, leading to memory leaks. The fix is to check that the tlv length is what is expected when receiving, and tlv_post_recv needs to return an int to signal when a tlv is invalid. Signed-off-by: Geoff Salmon <[email protected]>
- Loading branch information
1 parent
d666149
commit 533c771
Showing
3 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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