summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Herhut <herhut@chromium.org>2019-01-08 11:15:10 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2019-03-28 15:23:27 +0000
commite54c1076009a61d8885457fec2f6541ad2a856bd (patch)
tree26baf1b0877a7b742581c6353cce8f85a87ae0ce
parentdd18af1614f606475d9e7ab2a141f58fe2ede9b6 (diff)
downloadqtwebengine-chromium-e54c1076009a61d8885457fec2f6541ad2a856bd.tar.gz
[Backport] Security Bug 919572
Enfore valid register for SignExtendWord8ToInt32. On ia32, the instruction selector uses movsx_b to compile the wasm SignExtendWord8ToInt32 instruction. movsx_b requires a byte register as input. However, not all allocatable registers on ia32 are. As we cannot currently express constraints on subsets of registers, this change now forces the input to movsx_b into eax. Bug: chromium:919572 Reviewed-on: https://chromium-review.googlesource.com/c/1400409 Change-Id: I40b128958b5994bdcba5c313a8d5f1986565fa64 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--chromium/v8/src/compiler/ia32/instruction-selector-ia32.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chromium/v8/src/compiler/ia32/instruction-selector-ia32.cc b/chromium/v8/src/compiler/ia32/instruction-selector-ia32.cc
index 41442542850..d523a70e99a 100644
--- a/chromium/v8/src/compiler/ia32/instruction-selector-ia32.cc
+++ b/chromium/v8/src/compiler/ia32/instruction-selector-ia32.cc
@@ -174,7 +174,11 @@ namespace {
void VisitRO(InstructionSelector* selector, Node* node, ArchOpcode opcode) {
IA32OperandGenerator g(selector);
- selector->Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
+ Node* input = node->InputAt(0);
+ // We have to use a byte register as input to movsxb.
+ InstructionOperand input_op =
+ opcode == kIA32Movsxbl ? g.UseFixed(input, eax) : g.Use(input);
+ selector->Emit(opcode, g.DefineAsRegister(node), input_op);
}