-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in Zonemaster::Engine::Nameserver #324
Comments
Is t/test01.t from Engine or Backend? |
The one in zonemaster/zonemaster-backend@6a363a3. |
What happens is Zonemaster::Engine::preload_cache() is called with invalid cache data. That procedure should validate its input. Otherwise other parts of Zonemaster::Engine can't trust the format of the cache data, and invalid cache data can go unnoticed only to show up in unexpected places. |
The issue for zonemster-backend was resolved by correcting the test01.data file for zonemaster-backend in PR zonemaster/zonemaster-backend#299. See commit zonemaster/zonemaster-backend@516a5cb @mattias-p, should this issue still be kept open? |
@matsduf Yes, I updated the description with more details. |
@mattias-p Is this issue still relevant? |
@matsduf, @sandoche2k I updated the test code with informational print lines to make it clearer. This issue has not been fixed. |
@mattias-p, is this still relevant? |
Will be fixed by #778. |
Zonemaster::Engine::Nameserver is tripped up by the Backend test suite in zonemaster/zonemaster-backend#299.
Update:
The problem is that the internal state of Zonemaster::Engine can be poisoned, causing Zonemaster::Engine->add_fake_delegation() to crash when called with valid input.
The poisoning is caused in this case by Zonemaster::Engine::Nameserver->preload_cache() at the interface level, and by Zonemaster::Engine::Nameserver::Cache->new() at a deep level. These procedures are called with invalid input, and instead of catching and reporting the error, they poison the internal state.
The invalid input should be caught before the internal state is poisoned so that error symptoms surface close to their source.
Here's a minimized test case. Zonemaster::Engine::Nameserver::Cache->new() returns normally even though it's arguments are invalid, and Zonemaster::Engine->add_fake_delegation() crashes even though it's arguments are valid.
Update 2020-09-10:
#498 updated the cache implementation, breaking the test code given here. So I've updated the test code to demonstrate that the original issue is still present in the code.
The text was updated successfully, but these errors were encountered: