Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1133917

Summary: Huge address range in config leads to crash of dhcp server
Product: Red Hat Enterprise Linux 6 Reporter: Ladislav Jozsa <ljozsa>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: jikortus, jstodola, mganisin, praiskup, sengork, thozza
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.1.1-50.P1.el6 Doc Type: Bug Fix
Doc Text:
Cause When the pool of addresses the ISC dhcp server is configured to serve is very big. Consequence Server crashes during starting up. Fix A patch was backported. Result Program issues a warning and exits gracefully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 20:51:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1083985    
Attachments:
Description Flags
dhcpd.conf none

Description Ladislav Jozsa 2014-08-26 12:43:53 UTC
Description of problem:
When ISC dhcp server is configured to serve addresses from a huge pool of 
addresses it crashes. Sample config:


default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 10.0.0.0 netmask 255.0.0.0 {
  range 10.0.0.2 10.255.255.254;
  option routers 10.0.0.1;
  option domain-name-servers 10.0.0.1;
}

# service dhcpd start
Starting dhcpd:                                            [FAILED]

Excerpts from /var/log/messages:
Aug 26 08:36:23 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Aug 26 08:36:23 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Aug 26 08:36:23 localhost dhcpd: All rights reserved.
Aug 26 08:36:23 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Aug 26 08:36:24 localhost kernel: dhcpd[1825]: segfault at 7ffd924fc000 ip 00007ffd948ce5a9 sp 00007fffa110b938 error 7 in libc-2.12.so[7ffd9484a000+18b000]
Aug 26 08:36:27 localhost abrtd: Directory 'ccpp-2014-08-26-08:36:24-1825' creation detected
Aug 26 08:36:27 localhost abrt[1828]: Saved core dump of pid 1825 (/usr/sbin/dhcpd) to /var/spool/abrt/ccpp-2014-08-26-08:36:24-1825 (600719360 bytes)
Aug 26 08:36:27 localhost abrtd: Size of '/var/spool/abrt' >= 1000 MB, deleting 'ccpp-2014-08-26-08:24:14-3407'

When I decrease size of the address pool to for example 

range 10.0.0.2 10.255.255.254;

then dhcpd complains that it has not enough memory.

Aug 26 08:39:19 localhost dhcpd: No memory for address range 10.0.0.2-10.100.255.255.

Version-Release number of selected component (if applicable):
dhcp-4.1.1-43.P1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. # ip a a 10.0.0.1/8  dev eth0
2. # ip li se dev eth0 up
3. copy attached config file to /etc/dhcp/dhcpd.conf
4. # service dhcpd start

Actual results:
SIGSEGV received upon start.

Expected results:
A warning in the log or successful server start.

Additional info:
# free
             total       used       free     shared    buffers     cached
Mem:       1020348     858060     162288        200      18880     704528
-/+ buffers/cache:     134652     885696
Swap:       835580        132     835448

Comment 1 Ladislav Jozsa 2014-08-26 12:46:16 UTC
Created attachment 930905 [details]
dhcpd.conf

Comment 2 Ladislav Jozsa 2014-08-26 12:48:21 UTC
Sorry the decreased address pool should be

range 10.0.0.2 10.100.255.255;

It is obvious from the log message.

Comment 5 Jiri Popelka 2015-02-24 16:25:40 UTC
I've been able to reproduce the crash with "vanilla" 4.1.1-P1 and even latest 4.3.2rc1. I tried to debug it (gdb & valgrind) but I don't think I understand what's going on. I reported that upstream ([ISC-Bugs #38705]), but don't expect any response since it's not a real life use-case (the range is really huge).

Comment 6 Jiri Popelka 2015-04-13 08:15:16 UTC
https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=commitdiff;h=653f509b526f8da2e918178a39b27d80be37f158
looks (I haven't tested it yet) like a fix for this issue.

Comment 13 sengork 2016-05-04 00:46:10 UTC
Not sure if the issue is intermittently back:

dhcpd[9830]: segfault at 7fff47a45ff8 ip 00007fe1be42e57a sp 00007fff47a46000 error 6 in libc-2.12.so (deleted)[7fe1be3ba000+18a000]

# rpm -qa --last | grep glibc-2.12-1.166.el6_7.7.x86_64
glibc-2.12-1.166.el6_7.7.x86_64               Thu 21 Apr 2016 10:36:57 AM AEST

Comment 14 Jiri Popelka 2016-05-04 07:45:20 UTC
(In reply to sengork from comment #13)
> Not sure if the issue is intermittently back:

back ? the fix has not been released yet. What does 'rpm -q dhcpd' say ?

Comment 15 sengork 2016-05-05 01:48:08 UTC
# rpm -qf /usr/sbin/dhcpd
dhcp-4.1.1-49.P1.el6.x86_64

Comment 16 sengork 2016-05-05 01:53:33 UTC
# rpm -qa | grep -i dhcp
dhcp-4.1.1-49.P1.el6.x86_64
dhcp-common-4.1.1-49.P1.el6.x86_64

Comment 17 Jiri Popelka 2016-05-05 07:13:34 UTC
And the fixed (not released yet) version is dhcp-4.1.1-50.P1.el6

Comment 18 Jiri Popelka 2016-05-05 07:38:14 UTC
You can try RPMs from
https://jpopelka.fedorapeople.org/dhcp/bz1133917/

Comment 20 errata-xmlrpc 2016-05-10 20:51:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-0803.html