gt_sdma_handle_rxqueue does not truncate the packet length correctly
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 405
- Forks
- 99
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
gt_sdma_handle_rxqueue truncates the value of pkt_len:
https://github.com/GNS3/dynamips/blob/804ae0cdc84df30dbeac9599b3827905b7e6adab/common/dev_gt.c#L1098-L1099
but the only use of pkt_len happens before that, in line 1094.
Possible consequence: a big packet might cause a buffer overflow (probably in the vm memory instead of dynamips itself)
Discovered while converting to rust.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in common/dev_gt.c at gt_sdma_handle_rxqueue, especially lines 1094 and 1098-1099 linked in the issue, and trace the order in which pkt_len is used and truncated. Done means the packet length is safely bounded before its use and large-packet handling no longer permits the reported buffer-overflow consequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100