vmd(8): malicious dhcp packets on local ifs can cause stack overflows
authordv <dv@openbsd.org>
Tue, 8 Jun 2021 14:37:48 +0000 (14:37 +0000)
committerdv <dv@openbsd.org>
Tue, 8 Jun 2021 14:37:48 +0000 (14:37 +0000)
commit067df316555a30596b128ffab328424e13113f90
tree52da84ef55c73f07de3bece612f0099758545eda
parent7599ce71154c89733ec637d43c506d060458ba96
vmd(8): malicious dhcp packets on local ifs can cause stack overflows

A sufficiently large dhcp packet can cause a stack overflow in vmd's
internal dhcp server used for providing ip addresses to local guest
interfaces. (This does not affect non-local interfaces.)

The primary changes drop larger packets and change the memory copying
logic to use a compile-time constant. The dhcp option processing
also additional prevention for out of bound reads.

While here, improve construction of the dhcp response's hostname
handling to guard against overflowing the response dhcp options.

Vulnerability reported by Maxime Villard.

ok claudio@
usr.sbin/vmd/dhcp.c