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 1355827

Summary: dhcpd has a segfault at startup with a big ip range
Product: Red Hat Enterprise Linux 7 Reporter: Richard D Alloway <ralloway>
Component: dhcpAssignee: Pavel Zhukov <pzhukov>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: low Docs Contact:
Priority: high    
Version: 7.2CC: jstodola, mganisin, ralloway, thozza
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.2.5-52.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:38:58 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: 1380362, 1393869    
Attachments:
Description Flags
Proposed patch none

Description Richard D Alloway 2016-07-12 15:49:44 UTC
Description of problem:

(At the request of a developer at bugs.centos.org, I'm recreating bugs.centos.org ticket 0010640 here)

dhcpd has a segmentation fault at startup when there is a big ip range in dhcpd.conf. Here is the log :

Mar 31 10:56:35 coreadmin dhcpd: Internet Systems Consortium DHCP Server 4.2.5
Mar 31 10:56:35 coreadmin dhcpd: Copyright 2004-2013 Internet Systems Consortium.
Mar 31 10:56:35 coreadmin dhcpd: All rights reserved.
Mar 31 10:56:35 coreadmin dhcpd: For info, please visit https://www.isc.org/software/dhcp/ [^]
Mar 31 10:56:37 coreadmin kernel: dhcpd[30360]: segfault at 0 ip (null) sp 00007ffeebf338f8 error 14


Version-Release number of selected component (if applicable):
Reported for ISC DHCP 4.2.5

How reproducible:
Always

Steps to Reproduce:
Install dhcp :
1. yum install -y dhcp

2. Edit configuration file dhcpd.conf like that :
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
option domain-name "exemple.local";
option domain-name-servers 192.168.1.37, 192.168.1.36;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
authoritative;
subnet 10.0.0.0 netmask 255.0.0.0 {
    range dynamic-bootp 10.1.0.0 10.255.255.254;
    option broadcast-address 10.255.255.255;
    option routers 10.0.0.1;
}

3. Try to start dhcpd : systemctl start dhcpd

Actual results:

dhcpd has a segmentation fault at startup when there is a big ip range in dhcpd.conf. Here is the log :

Mar 31 10:56:35 coreadmin dhcpd: Internet Systems Consortium DHCP Server 4.2.5
Mar 31 10:56:35 coreadmin dhcpd: Copyright 2004-2013 Internet Systems Consortium.
Mar 31 10:56:35 coreadmin dhcpd: All rights reserved.
Mar 31 10:56:35 coreadmin dhcpd: For info, please visit https://www.isc.org/software/dhcp/ [^]
Mar 31 10:56:37 coreadmin kernel: dhcpd[30360]: segfault at 0 ip (null) sp 00007ffeebf338f8 error 14

Expected results:
A handling of the overly large IP range, including a verbose error message and a graceful exit.

Additional info:
This problem is not occuring when I modify this line in configuration file :
range dynamic-bootp 10.1.0.0 10.255.255.254;

to this :
range dynamic-bootp 10.255.255.0 10.255.255.254;

Comment 1 Richard D Alloway 2016-07-12 15:50:58 UTC
Created attachment 1178959 [details]
Proposed patch

I backported the existing patch for this issue as noted in ISC Bugs 38637 (https://kb.isc.org/article/AA-01285/82/DHCP-4.3.3b1-Release-Notes.html [^]) and added more information and a link to a URL which explains how to serve more than 14 million IPs with ISC DHCP.

Comment 2 Richard D Alloway 2016-07-12 15:51:35 UTC
I was able to replicate this issue.

The patch has been attached to the ticket.

Let me know if you have any questions.

Thanks!

-Rich Alloway (RogueWave)

Comment 4 Pavel Šimerda (pavlix) 2016-08-03 13:56:51 UTC
I confirmed the segfault. It doesn't even need IP address configuration.

(In reply to Richard D Alloway from comment #1)
> Created attachment 1178959 [details]
> Proposed patch
> 
> I backported the existing patch for this issue as noted in ISC Bugs 38637
> (https://kb.isc.org/article/AA-01285/82/DHCP-4.3.3b1-Release-Notes.html [^])
> and added more information and a link to a URL which explains how to serve
> more than 14 million IPs with ISC DHCP.

Where do I find the patch? It is not included in the dist-git patch unfortunately and I wasn't able to find it using the ISC bug number. Thanks.

Comment 5 Richard D Alloway 2016-08-03 14:33:46 UTC
Hi Pavel!

Sorry for the confusion.  It wasn't an actual patch that I backported.  I created my own patch by comparing the source of server/mdb.c from ISC DHCP 4.2.8 and 4.3.4.

In the 4.3.4 source, the changes are lines 826-849 of server/mdb.c.

My patch for 4.2.5 is included in the attachments portion of this ticket.

Let me know if you have any further questions.

Thanks!

-Rich Alloway (RogueWave)

Comment 9 Pavel Šimerda (pavlix) 2017-02-16 15:37:17 UTC
Note: The result of the patch ISC DHCP exits with failure. The difference is that the failure is not a segmentation fault but an actuall error message. Example below.

dhcpd[14409]: /etc/dhcp/dhcpd.conf line 8: 10.1.0.0-10.255.255.254 is an overly large address range.
dhcpd[14409]:     range dynamic-bootp 10.1.0.0 10.255.255.254;
dhcpd[14409]:                                                 ^
dhcpd[14409]: Consider breaking large address ranges into multiple scopes of less than 14 million IPs each.
dhcpd[14409]: For more information, please visit:  https://support.roguewave.com/resources/blogs/openlogic-blogs/how-to-extend-isc-dhcp/
dhcpd[14409]: Memory overflow.

Comment 12 errata-xmlrpc 2017-08-01 20:38:58 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://access.redhat.com/errata/RHBA-2017:1956