Skip to content
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

New tickle_tcp implementation #1451

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

raltnoeder
Copy link

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.

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.
@knet-ci-bot
Copy link

Can one of the admins verify this patch?

@oalbrigt
Copy link
Contributor

We do not want to rewrite this from scratch, as it's likely to introduce new issues to users where it worked fine before.

@raltnoeder
Copy link
Author

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.
For any potential users who integrated the utility in their own custom software (unlikely in the first place), a simple changelog entry should suffice.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants