Red Hat Bugzilla – Bug 57016
buffer overrun in bootp/dhcp code
Last modified: 2007-04-18 12:38:32 EDT
Description of Problem:
The reply from a DHCP server contains variable length options. Many of
these options are a list. In many places the code passes parameters to
get_bootp_option() to accept one entry from the list. If, for example, the
DHCP reply contains two routers, the first will be placed into the stack
variable gateway and the second will got splat over what ever is next on
get_bootp_option() should take an addition parameter, the size of the
buffer it should copy into.
Theorectical bug only. Not tried it out yet. Configure your dhcp/bootp
server to reply with a list and see if it crashes.
While fixing it i found we have a few other patches for the DHCP client in our
tree which never got contributed back. They are not my patches so i don't know
the details fully.
It looks like the xid is being calculated at the wrong time. Each retry should
use the same xid. If it does not, and the server is slow, by the time its
replied, the client has a new xid and so ignores the reply. This realy shows up
with our server. Before replying it pings the IP address its about the give out
just to make sure its not being used. This can take a second by which time the
client has done few tries with different xids. The server replies with the old
xid and the client ignores it. The process only works once the client has backed
off so giving the server time to reply.
The second problem was that the xid was not changing in the message sent when it
This patch fixed the buffer overrun as well! It overlaps the DHCP DNS patch so
you probably want to add that patch first.
Created attachment 39427 [details]
Context diff to 1.5.2-final.
Commited to main CVS repository - trunk only