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
limit $GENERATE range to 2^16? #1019
Comments
That sounds reasonable. What do other DNS servers do? |
[ Quoting <notifications@github.com> in "Re: [miekg/dns] limit $GENERATE ran..." ]
That sounds reasonable. What do other DNS servers do?
i have no idea... $GENERATE is a bind-ism (originally)
|
Fixes #1019 Signed-off-by: Miek Gieben <miek@miek.nl>
Having these checks means all test in TestCrasherString() are not reached because we bail out earlier - removed that test all together. Fixes #1019 Signed-off-by: Miek Gieben <miek@miek.nl>
From: https://ftp.isc.org/isc/bind9/cur/9.11/doc/arm/Bv9ARM.ch06.html#generate_directive
|
[ Quoting <notifications@github.com> in "Re: [miekg/dns] limit $GENERATE ran..." ]
From: https://ftp.isc.org/isc/bind9/cur/9.11/doc/arm/Bv9ARM.ch06.html#generate_directive
> range: This can be one of two forms: start-stop or start-stop/step. If the first form is used, then step is set to 1. start, stop and step must be positive integers between 0 and (2^31)-1. start must not be larger than stop.
this ooms my test (on my machine) - and it's a very large number for something
like this - not sure how to preceed. Use this number or something smaller?
|
it seems sensible to me to use something smaller. There is obviously no users of this feature with that many steps (or they would have reported it). |
[ Quoting <notifications@github.com> in "Re: [miekg/dns] limit $GENERATE ran..." ]
it seems sensible to me to use something smaller. There is obviously no users of this feature with that many steps (or they would have reported it).
I think a sane limit is a simple fix. Supporting the bind behaviour may require a more substantial change which may not be worth it.
thanks. I agree with that.
|
* Limit $GENERATE range to 65535 steps Having these checks means all test in TestCrasherString() are not reached because we bail out earlier - removed that test all together. Fixes #1019 Signed-off-by: Miek Gieben <miek@miek.nl> * bring back testcase Signed-off-by: Miek Gieben <miek@miek.nl> * bring back crash test Signed-off-by: Miek Gieben <miek@miek.nl>
and another flavor:
this ends up calling generate on generate :) |
would seem to work when dogsciencing but will likely break if there is 2 lines with the GENERATE directive. |
@chantra To prohibit $GENERATE in $GENERATE, it would be better to set a field on the sub parser created in generate.go. That won’t conflict with multiple $GENERATE directives in one zonefile like your patch will. |
@tmthrgd I missed that.... I had tried to set it in the lexer or something... not the sub parser. diffing a fix. |
* Limit $GENERATE range to 65535 steps Having these checks means all test in TestCrasherString() are not reached because we bail out earlier - removed that test all together. Fixes miekg#1019 Signed-off-by: Miek Gieben <miek@miek.nl> * bring back testcase Signed-off-by: Miek Gieben <miek@miek.nl> * bring back crash test Signed-off-by: Miek Gieben <miek@miek.nl>
a $GENERATE range that is too large will cause a panic, it make sense to limit this to something reasonable. I propose to limit the number of steps to 65535, i.e.
(stop - start) / step > 65535
, and error out if we hit this.The text was updated successfully, but these errors were encountered: