Red Hat Bugzilla – Bug 498658
dhclient makes system unresponsive with very short leases
Last modified: 2010-03-30 04:18:52 EDT
Created attachment 342132 [details]
Use 60 seconds as minimum for a lease
Description of problem:
When a system running dhclient gets a very short lease, it goes completely crazy and it looks like kind of a DOS.
Version-Release number of selected component (if applicable):
Note: all ISC dhcp versions seem affected, I have checked dhcp-4.1.1b1 and it seems to do exactly the same.
Steps to Reproduce:
1. Configure a dhcp server with 'dhcp-lease-time 2'
2. Start 'dhclient' on a client
The client tries to renew it's lease in a loop as fast as it can. The network connection becomes almost unusable and the system becomes almost unresponsive. Of course dhclient floods the clients log and may quickly fill the /var filesystem. The system spends much time running dhclient-script for every request. The whole thing looks like a DOS.
As a side effect the same log flooding happens on the server - but he gets what he deserves.
dhclient should add a sanity check to make sure it doesn't bring the system down when getting short leases. The OpenBSD and other BSD folks have done so and they seems to live well with it: http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c.diff?r1=1.57;r2=1.58;f=h
AFAIK DHCP doesn't define a minimum lease time. However, it's not good that a badly configured DHCP server can melt down it's clients so easy. I have seen this kind of 2 second leases on mobile broadband networks (GPRS/UMTS/HDSPA). I usually get leases of about 300 seconds but from time to time it is reduced to 2 seconds for whatever reason.
If, in a large corporat network, someone is able to run it's own DHCP server and configures 'dhcp-lease-time 2' on it, he may be able to make a lot of machines unusable very quickly. It just looks too easy to me.
Attached patch derived from OpenBSD uses a minimum of 60 seconds for it's lease which means it starts renewing it every ~27 seconds.
Created attachment 342134 [details]
RPM package patch I use for myself
what's the minimum max-lease-time value below which we'd like the client application to update it's lease every 30 seconds or so? I.e. if max-lease-time==10 how often should the client update?
I agree with minimum lease time set to 60 seconds.
When the server is configured with max-lease-time less then 60 seconds, client
uses 60 seconds for his lease time, which means it starts renewing it every ~27
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
Tested with dhclient-3.0.5-23.el5 and a server configured with max-lease-time 2.
The client is renewing its address every 30 seconds or so which matches the described behavior above.
Just FYI the client in RHEL 5.4 was renewing the leases every 0-1 seconds.
Moving to VERIFIED.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.