Issue metadata
Sign in to add a comment
|
Security: [arm] OOB r/w due to size computation bug in MacroAssembler::Allocate |
||||||||||||||||||||||
Issue description
VULNERABILITY DETAILS
The arm32 implementation of V8's MacroAssembler::Allocate(int object_size, ...) can get confused about its handrolled object_start + object_size computation: the "add" instructions (except for the first) erroneously use the "cc" condition (carry bit set), which is not updated by the allocation code sequence, but inherited from whatever code ran before. This results in a too-low object_end being compared against the allocation limit. The allocation appears to succeed, but the returned object has a larger size than what was checked and recorded, so it might extend beyond the end of the current page, or overlap with the next object.
VERSION
Chrome Version: 52 to ToT
Operating System: all arm32 platforms (Android, ChromeOS)
REPRODUCTION CASE
// Flags: --allow-natives-syntax
var g_eval = eval;
function emit_f(size) {
var body = "function f(x) {" +
" if (x < 0) return x;" +
" var a = [1];" +
" if (x > 0) return [";
for (var i = 0; i < size; i++) {
body += "0.1, ";
}
body += " ];" +
" return a;" +
"}";
g_eval(body);
}
// Length must be big enough to make the backing store's size not fit into
// a single instruction's immediate field (2^12).
var kLength = 701;
emit_f(kLength);
f(1);
f(1);
%OptimizeFunctionOnNextCall(f);
var a = f(1);
// Allocating something else should not disturb |a|.
var b = new Object();
for (var i = 0; i < kLength; i++) {
assertEquals(0.1, a[i]);
}
// Allocating more should not crash.
for (var i = 0; i < 300; i++) {
f(1);
}
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: tab
Crash State: segfault
,
Nov 8 2016
,
Nov 9 2016
,
Nov 10 2016
Fixed on ToT by #1, waiting for Canary/Dev coverage before requesting backmerge.
,
Nov 10 2016
,
Nov 12 2016
,
Nov 12 2016
Your change meets the bar and is auto-approved for M55 (branch: 2883)
,
Nov 14 2016
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/fb84109cd1f2c4115cf9b348d8a9971656aa4d8b commit fb84109cd1f2c4115cf9b348d8a9971656aa4d8b Author: Jakob Kummerow <jkummerow@chromium.org> Date: Mon Nov 14 10:48:34 2016 Merged: [arm] Fix custom addition in MacroAssembler::[Fast]Allocate Revision: 87332fdf677f1b53f71be7c05d025a285e5a5c73 BUG= chromium:663402 LOG=N NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true R=cbruni@chromium.org Review URL: https://codereview.chromium.org/2500843002 . Cr-Commit-Position: refs/branch-heads/5.5@{#42} Cr-Branched-From: 3cbd5838bd8376103daa45d69dade929ee4e0092-refs/heads/5.5.372@{#1} Cr-Branched-From: b3c8b0ce2c9af0528837d8309625118d4096553b-refs/heads/master@{#40015} [modify] https://crrev.com/fb84109cd1f2c4115cf9b348d8a9971656aa4d8b/src/arm/macro-assembler-arm.cc [add] https://crrev.com/fb84109cd1f2c4115cf9b348d8a9971656aa4d8b/test/mjsunit/regress/regress-crbug-663402.js
,
Nov 14 2016
,
Feb 16 2017
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by bugdroid1@chromium.org
, Nov 8 2016