Bug 1238

Summary: segmentation fault when adding through the remote interface a per-view local zone to a view with no previous (configured) local zones
Product: unbound Reporter: akocmaruk
Component: serverAssignee: unbound team <unbound-team>
Severity: normal CC: cathya, wouter
Priority: P5    
Version: unspecified   
Hardware: x86_64   
OS: Windows   
Attachments: Infoblox fix for the problem

Description akocmaruk 2017-03-21 22:11:39 CET
Created attachment 387 [details]
Infoblox fix for the problem

Here are the high-level defect reproduction steps:

- define an empty view in configuration, e.g.
    name: view3

(note there are no local zones defined for this view)

- start unbound configured for remote control

- add one local zone to this view via remote command:
    $ unbound-control view_local_zone view3 abc.com always_nxdomain

- observe the crash

In our environment this problem was fixed with the attached patch. This patch does introduce a potential for some heap waste, however this is not expected to become a serious issue.

Note also that the potential for similar bug exists with the per-view respip configuration as well. Currently this is not an issue (at least not in our environment), as the remote command for defining the per-view respip directives is not yet implemented.
Comment 1 Wouter Wijngaards 2017-03-22 08:20:22 CET

Fixed this, by creating the local zones when needed in remote.c.  This does not waste memory for them.  Thanks for the report!

Best regards, Wouter