Skip to content

Return early from parsing DHCP response if End is encoutered#168

Merged
slp merged 1 commit intoAsahiLinux:mainfrom
nrabulinski:fix-dhcp
Apr 21, 2025
Merged

Return early from parsing DHCP response if End is encoutered#168
slp merged 1 commit intoAsahiLinux:mainfrom
nrabulinski:fix-dhcp

Conversation

@nrabulinski
Copy link
Copy Markdown
Contributor

Up until now DHCP response was parsed by reading the option and the length first. The length field obviously does not apply to the End option, so if muvm got a response that ended exactly at the End byte, muvm would crash because of an out-of-bound read.

This works with older versions of passt because the response muvm received was longer than it could've been. Latest version of passt sends only as many bytes as necessary.

cc @sbrivio-rh

Up until now DHCP response was parsed by reading the option
and the length first. The length field obviously does not
apply to the End option, so if muvm got a response that ended exactly
at the End byte, muvm would crash because of an out-of-bound read.

Signed-off-by: Nikodem Rabuliński <[email protected]>
@sbrivio-rh
Copy link
Copy Markdown
Contributor

The length field obviously does not apply to the End option

Oops. It wasn't so obvious to me at some point, see: https://archives.passt.top/passt-dev/20250210191547.5cf0698a@elisabeth/, and I forgot to check against this implementation afterwards. :(

Thanks for fixing this!

Reviewed-by: Stefano Brivio <[email protected]>

@nrabulinski
Copy link
Copy Markdown
Contributor Author

Oops. It wasn't so obvious to me at some point

Haha yeah, hindsight is 20/20. Also, I did not realize you were behind passt (and the dhcp implementation in particular)! Thanks for your hard work! I should've paid more attention to commit authors 😁

@sbrivio-rh
Copy link
Copy Markdown
Contributor

You're welcome! I'm glad you use / like it!

@slp slp merged commit 9070493 into AsahiLinux:main Apr 21, 2025
2 checks passed
slp added a commit to slp/krun that referenced this pull request Apr 21, 2025
Prepare for an expedited minor release to address a crash when parsing
a DHCP response from passt (see AsahiLinux#168).

Signed-off-by: Sergio Lopez <[email protected]>
@slp slp mentioned this pull request Apr 21, 2025
slp added a commit that referenced this pull request Apr 21, 2025
Prepare for an expedited minor release to address a crash when parsing
a DHCP response from passt (see #168).

Signed-off-by: Sergio Lopez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants