-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[M90-LTS] Protect candidate better from garbage collection during neg…
…otiation. Includes a test that was reliably observed to produce an UAF on Linux when compiled with ASAN before the fix. (cherry picked from commit 654536e) Bug: chromium:1230767 Change-Id: I02dd29332a6d00790dcace41b6584b96413ef6f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3057049 Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#910244} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3102948 Reviewed-by: Artem Sumaneev <asumaneev@google.com> Owners-Override: Artem Sumaneev <asumaneev@google.com> Commit-Queue: Roger Felipe Zanoni da Silva <rzanoni@google.com> Cr-Commit-Position: refs/branch-heads/4430@{#1570} Cr-Branched-From: e5ce7dc-refs/heads/master@{#857950}
- Loading branch information
1 parent
d8f7a22
commit 010a318
Showing
2 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
third_party/blink/web_tests/fast/peerconnection/poc-123067.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script src="../../resources/gc.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
'use strict'; | ||
promise_test(async t => { | ||
const var_caller_1 = new RTCPeerConnection(); | ||
const var_callee_1 = new RTCPeerConnection(); | ||
var_caller_1.addTransceiver('audio'); | ||
const var_prom_1 = new Promise(resolve => { | ||
var_caller_1.onicecandidate = e => resolve(e.candidate); | ||
}); | ||
await var_caller_1.setLocalDescription(await var_caller_1.createOffer()); | ||
await var_callee_1.setRemoteDescription(var_caller_1.localDescription); | ||
const candidate = await var_prom_1; | ||
var arrProm = []; | ||
gc(); | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.setLocalDescription().then(() => { | ||
}) | ||
var_callee_1.addIceCandidate(candidate).then(() => { | ||
}) | ||
await Promise.all(arrProm); | ||
}, 'Running this script does not cause an UAF'); | ||
</script> | ||
</head> | ||
|
||
<body></body> | ||
|
||
</html> |