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

Don't allow small units of application data to keep large packets in memory #431

Closed
Ralith opened this issue Sep 9, 2019 · 2 comments
Closed

Comments

@Ralith
Copy link
Collaborator

Ralith commented Sep 9, 2019

Quinn uses zero-copy refcounted Bytes for most processing of incoming data. At the extreme, a hostile peer could send numerous stream frames containing a single byte in a packet padded to MTU size. We could combat this by heuristically opting to copy segments of application data into freshly allocated memory when they fall below a certain proportion of the packet, or when a packet consists of a small proportion of application data, or similar.

@Ralith
Copy link
Collaborator Author

Ralith commented Sep 19, 2019

Peer Denial of Service:

While there are legitimate uses for all messages, implementations SHOULD track
cost of processing relative to progress and treat excessive quantities of any
non-productive packets as indicative of an attack. Endpoints MAY respond to
this condition with a connection error, or by dropping packets.

Something to consider if exceptionally unreasonable packet constructions are detected, although we probably want to be forgiving of mildly buggy QUIC implementations.

@Ralith
Copy link
Collaborator Author

Ralith commented Oct 22, 2019

@carllerche has discussed the possibility of using Bytes with a custom allocator that's able to efficiently free random slices of an allocation, which would solve this problem very handily indeed.

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

No branches or pull requests

1 participant