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

dnsdist: Fix handling of proxy protocol payload outside of TLS for DoT #14636

Merged

Commits on Sep 9, 2024

  1. dnsdist: Fix handling of proxy protocol payload outside of TLS for DoT

    After reading the proxy protocol payload from the I/O buffer
    we were clearing the buffer but failed to properly reset the
    position, leading to an exception when trying to read the DNS
    payload after processing the TLS handshake:
    
    ```
    Got an exception while handling (reading) TCP query from 127.0.0.1:59426: Calling tryRead() with a too small buffer (2) for a read of 18446744073709551566 bytes starting at 52
    ```
    
    The huge value comes from the fact that the position (52 here)
    is larger than the size of the buffer (2 at this point to read
    the size of the incoming DNS payload), leading to an unsigned
    underflow. The code is properly detecting that the value makes
    no sense in this context, but the connection is then dropped
    because we cannot recover.
    
    It turns out we had a end-to-end test for the "proxy protocol
    outside of TLS" case but only over incoming DoH, and the DoH
    case avoids this specific issue because the buffer is always
    properly resized, and the position updated.
    rgacogne committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    4931fb2 View commit details
    Browse the repository at this point in the history