Conversation
Prepare the source tree for adding a new implementation
of the tickle_tcp utility, to fix various issues in the
current implementation, e.g.:
- Buffer overflow in the parser
- Write access to datastructures previously declared 'const'
- Reliance on Linux-only datastructures (struct iphdr)
- Some unfinished code, dead code or code that executes, but
has no effect
(e.g. close on exec, but the utility never executes anything)
- Some less important issues, like reinterpretation of parsed
negative numbers as positive numbers, due to the loose
parsing provided by the strtoul function
This commit replaces the previous implementation of tickle_tcp with a new implementation. Apart from fixing various problems of the previous implementation, the new implementation adds support for link-local IPv6 addresses which was incomplete in the previous implementation (although that does not seem really useful anyway), and it has a more whitespace-tolerant parser. This implementation should also be more portable than the previous one, which relied on Linux-specific data structures.
The new tickle_tcp implementation requires compilation in C99 (or newer) mode.
|
Can one of the admins verify this patch? |
|
We do not want to rewrite this from scratch, as it's likely to introduce new issues to users where it worked fine before. |
|
I don't think the risk of introducing new issues to users where it worked even despite the problems in the previous implementation is anywhere near the risk that the previous implementation might break in the future, or for any new users or new use cases, and is also generally very low. The only current user of the utility is the portblock RA, the inputs accepted by the utility are backwards compatible, and any changed error messages to stderr or changed exit codes are never checked or otherwise used by anything. The reason why I started from scratch was that I was convinced that fixing the bugs in the previous implementation has a higher chance of introducing bugs and/or would be harder to develop and verify than a clean new implementation. If really necessary, I could also add compatibility tests, to enable testing of the input accepted and output and exit codes produced by both utilities under the same conditions. |
I originally stumbled upon a buffer handling problem when I attempted to use the previous tickle_tcp utility manually and began to investigate in order to fix that problem, but found more problems on the way and then decided to start from scratch instead.