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

rewrite the frame sorter #2561

Merged
merged 1 commit into from
May 25, 2020
Merged

rewrite the frame sorter #2561

merged 1 commit into from
May 25, 2020

Conversation

marten-seemann
Copy link
Member

@marten-seemann marten-seemann commented May 23, 2020

Fixes #2533, fixes #2544, fixes #2545. Fixes #2521, assuming that this error was a result of the race condition.

Adds a bunch of new test cases, including a randomized test, which would have caught the bugs.

@marten-seemann marten-seemann force-pushed the rewrite-frame-sorter branch 2 times, most recently from 0346e79 to 3a08979 Compare May 23, 2020 07:49
@codecov-commenter
Copy link

codecov-commenter commented May 23, 2020

Codecov Report

Merging #2561 into master will increase coverage by 0.05%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2561      +/-   ##
==========================================
+ Coverage   86.17%   86.22%   +0.05%     
==========================================
  Files         122      122              
  Lines        9550     9584      +34     
==========================================
+ Hits         8229     8263      +34     
- Misses        983      984       +1     
+ Partials      338      337       -1     
Impacted Files Coverage Δ
frame_sorter.go 96.92% <95.45%> (+1.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa69438...39fe927. Read the comment docs.

Copy link
Member

@lucas-clemente lucas-clemente left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but it's very difficult to read the diff here. For the future, it would be helpful if you outlined the major changes in the commit message :)

return gap.Prev(), false
}
}
panic("no gap found")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could an attacker trigger this panic by sending us a frame with offset = MaxByteCount?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd only read that frame if we read everything before MaxByteCount. Also, we'd trigger a flow control error before even enqueuing such a frame.

@marten-seemann marten-seemann merged commit fd5ecee into master May 25, 2020
@marten-seemann marten-seemann deleted the rewrite-frame-sorter branch May 25, 2020 12:03
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants