Changeset 248989 in webkit
- Timestamp:
- Aug 21, 2019 6:42:22 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r248955 r248989 1 2019-08-21 Mark Lam <mark.lam@apple.com> 2 3 Wasm::FunctionParser is failing to enforce maxFunctionLocals. 4 https://bugs.webkit.org/show_bug.cgi?id=201016 5 <rdar://problem/54579911> 6 7 Reviewed by Yusuke Suzuki. 8 9 * wasm/stress/too-many-locals.js: Added. 10 (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.catch): 11 1 12 2019-08-21 Ross Kirsling <ross.kirsling@sony.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r248951 r248989 1 2019-08-21 Mark Lam <mark.lam@apple.com> 2 3 Wasm::FunctionParser is failing to enforce maxFunctionLocals. 4 https://bugs.webkit.org/show_bug.cgi?id=201016 5 <rdar://problem/54579911> 6 7 Reviewed by Yusuke Suzuki. 8 9 Currently, Wasm::FunctionParser is allowing 10 11 maxFunctionParams + maxFunctionLocals * maxFunctionLocals 12 13 ... locals, which is 0x9502FCE8. It should be enforcing max locals of 14 maxFunctionLocals instead. 15 16 * wasm/WasmFunctionParser.h: 17 (JSC::Wasm::FunctionParser<Context>::parse): 18 1 19 2019-08-21 Michael Saboff <msaboff@apple.com> 2 20 -
trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h
r248878 r248989 116 116 auto FunctionParser<Context>::parse() -> Result 117 117 { 118 uint32_t local Count;118 uint32_t localGroupsCount; 119 119 120 120 WASM_PARSER_FAIL_IF(!m_context.addArguments(m_signature), "can't add ", m_signature.argumentCount(), " arguments to Function"); 121 WASM_PARSER_FAIL_IF(!parseVarUInt32(local Count), "can't get localcount");122 WASM_PARSER_FAIL_IF(localCount > maxFunctionLocals, "Function section's local count is too big ", localCount, " maximum ", maxFunctionLocals); 123 124 for (uint32_t i = 0; i < local Count; ++i) {121 WASM_PARSER_FAIL_IF(!parseVarUInt32(localGroupsCount), "can't get local groups count"); 122 123 uint64_t totalNumberOfLocals = m_signature.argumentCount(); 124 for (uint32_t i = 0; i < localGroupsCount; ++i) { 125 125 uint32_t numberOfLocals; 126 126 Type typeOfLocal; 127 127 128 128 WASM_PARSER_FAIL_IF(!parseVarUInt32(numberOfLocals), "can't get Function's number of locals in group ", i); 129 WASM_PARSER_FAIL_IF(numberOfLocals > maxFunctionLocals, "Function section's ", i, "th local group count is too big ", numberOfLocals, " maximum ", maxFunctionLocals); 129 totalNumberOfLocals += numberOfLocals; 130 WASM_PARSER_FAIL_IF(totalNumberOfLocals > maxFunctionLocals, "Function's number of locals is too big ", totalNumberOfLocals, " maximum ", maxFunctionLocals); 130 131 WASM_PARSER_FAIL_IF(!parseValueType(typeOfLocal), "can't get Function local's type in group ", i); 131 132 WASM_TRY_ADD_TO_CONTEXT(addLocal(typeOfLocal, numberOfLocals));
Note: See TracChangeset
for help on using the changeset viewer.