Long IFrame "src" attributes cause crash
Categories
(Core :: Networking: HTTP, defect, P2)
Tracking
()
People
(Reporter: bugzilla, Assigned: valentin)
Details
(4 keywords, Whiteboard: [necko-triaged])
Attachments
(3 files)
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
Updated•9 years ago
|
Comment 5•4 years ago
|
||
This still happens. The entire browser freezes, even with Fission. Do we have limits on IPC?
Comment 6•4 years ago
|
||
(In reply to Anne (:annevk) from comment #5)
This still happens. The entire browser freezes, even with Fission. Do we have limits on IPC?
We do have size limits on IPC, but this URL isn't long enough to exceed them. I'm guessing the slowness here is caused by the large number of .
characters which leads to a large number of subdomains being handled by our network layer. I ran the test under gdb, and randomly paused execution after a few seconds, and it appears we're spending a ton of time in TRRService::IsExcludedFromTRR_unlocked
here: https://searchfox.org/mozilla-central/rev/0379f315c75a2875d716b4f5e1a18bf27188f1e6/netwerk/dns/TRRService.cpp#793-828. It appears as though this code does 3 hashtable lookups for each .
character in the string, which understandably can become quite slow, especially as we're hashing subsets of the same very long string over and over again.
Given that the hang appears to be happening in necko code, I'll redirect this to the networking component.
Comment 7•4 years ago
|
||
Comment 8•4 years ago
|
||
Nika, amazing, thank you! Hopefully Valentin can take it from there.
Assignee | ||
Comment 9•4 years ago
|
||
I think it's time to start enforcing the 253 character limit on hostnames. Not totally sure why we don't do that already.
Assignee | ||
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #9)
I think it's time to start enforcing the 253 character limit on hostnames. Not totally sure why we don't do that already.
With this, the method in question will do a maximum of 254*3 hashtable lookups by my quick calculation. I think that effectively prevents a DoS.
I believe a name with consecutive dots (i.e. 0-length labels) is illegal. It looks like it would be pretty trivial to also add a check after we get the next dot's position to check if the char after that is also a dot, and if so, return false early. WDYT?
Comment 12•4 years ago
|
||
(In reply to Nihanth Subramanya [:nhnt11] from comment #11)
I believe a name with consecutive dots (i.e. 0-length labels) is illegal. It looks like it would be pretty trivial to also add a check after we get the next dot's position to check if the char after that is also a dot, and if so, return false early. WDYT?
Hmm, but I suppose it's weird to have the TRR service worry about valid/invalid domains, and the way the net_IsValidHostName is implemented right now this doesn't look trivial to add it there.
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
Backed out for causing failures on test_dns_service_wrap.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/3eb4bf72e783a7a2c28703c4b421a0271b9179a5
Failure log: https://treeherder.mozilla.org/logviewer?job_id=330489138&repo=autoland&lineNumber=3049
Assignee | ||
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
Backed out for causing failures on test_dns_service.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/92b9fb6c7c07ceef33cfe217c157764bbaf412c7
Failiure log: https://treeherder.mozilla.org/logviewer?job_id=330522050&repo=autoland&lineNumber=3266
Comment 17•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 18•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 20•3 years ago
|
||
I can. The testcase from comment 0 no longer hangs. \o/
Description
•