Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1355827 - dhcpd has a segfault at startup with a big ip range
Summary: dhcpd has a segfault at startup with a big ip range
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dhcp
Version: 7.2
Hardware: Unspecified
OS: Linux
high
low
Target Milestone: rc
: ---
Assignee: Pavel Zhukov
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1380362 1393869
TreeView+ depends on / blocked
 
Reported: 2016-07-12 15:49 UTC by Richard D Alloway
Modified: 2017-08-01 20:38 UTC (History)
4 users (show)

Fixed In Version: dhcp-4.2.5-52.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 20:38:58 UTC
Target Upstream Version:


Attachments (Terms of Use)
Proposed patch (deleted)
2016-07-12 15:50 UTC, Richard D Alloway
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
CentOS 0010640 None None None 2016-07-12 15:49:44 UTC
Red Hat Product Errata RHBA-2017:1956 normal SHIPPED_LIVE dhcp bug fix update 2017-08-01 18:30:17 UTC

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


Note You need to log in before you can comment on or make changes to this bug.