Bug 1238 - segmentation fault when adding through the remote interface a per-view local zone to a view with no previous (configured) local zones
segmentation fault when adding through the remote interface a per-view local ...
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
x86_64 Windows
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-21 22:11 CET by akocmaruk
Modified: 2017-03-22 08:20 CET (History)
2 users (show)

See Also:


Attachments
Infoblox fix for the problem (990 bytes, text/plain)
2017-03-21 22:11 CET, akocmaruk
Details

Note You need to log in before you can comment on or make changes to this bug.
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.
    view:
    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
Hi, 

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