Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4-2-x' into miniak/liftoff-correctly-unuse-labels-4-2-x
- Loading branch information
Showing
7 changed files
with
154 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# These env vars are only necessary for creating Electron releases. | ||
# See docs/development/releasing.md | ||
|
||
APPVEYOR_TOKEN= | ||
APPVEYOR_CLOUD_TOKEN= | ||
CIRCLE_TOKEN= | ||
ELECTRON_GITHUB_TOKEN= | ||
VSTS_TOKEN= |
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
43 changes: 43 additions & 0 deletions
43
...hes/common/chromium/filesystem_harden_against_overflows_of_operationid_a_bit_better.patch
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,43 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Marijn Kruisselbrink <mek@chromium.org> | ||
Date: Tue, 29 Jan 2019 19:51:07 +0000 | ||
Subject: [FileSystem] Harden against overflows of OperationID a bit better. | ||
|
||
Rather than having a UAF when OperationID overflows instead overwrite | ||
the old operation with the new one. Can still cause weirdness, but at | ||
least won't result in UAF. Also update OperationID to uint64_t to | ||
make sure we don't overflow to begin with. | ||
|
||
Bug: 925864 | ||
Change-Id: Ifdf3fa0935ab5ea8802d91bba39601f02b0dbdc9 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/1441498 | ||
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> | ||
Reviewed-by: Victor Costan <pwnall@chromium.org> | ||
Cr-Commit-Position: refs/heads/master@{#627115} | ||
|
||
diff --git a/storage/browser/fileapi/file_system_operation_runner.cc b/storage/browser/fileapi/file_system_operation_runner.cc | ||
index fbda72b3cdf851947aa697776e54e0b5092e729b..09af7c0c8c9099489286152009f05ad49d968174 100644 | ||
--- a/storage/browser/fileapi/file_system_operation_runner.cc | ||
+++ b/storage/browser/fileapi/file_system_operation_runner.cc | ||
@@ -701,7 +701,7 @@ FileSystemOperationRunner::BeginOperation( | ||
base::WeakPtr<BeginOperationScoper> scope) { | ||
OperationHandle handle; | ||
handle.id = next_operation_id_++; | ||
- operations_.emplace(handle.id, std::move(operation)); | ||
+ operations_[handle.id] = std::move(operation); | ||
handle.scope = scope; | ||
return handle; | ||
} | ||
diff --git a/storage/browser/fileapi/file_system_operation_runner.h b/storage/browser/fileapi/file_system_operation_runner.h | ||
index a330f4802d5d5c721d8bba460f25edc2f8e1340a..97f9e0d81163d08644f0cee5b9da21ac24b300af 100644 | ||
--- a/storage/browser/fileapi/file_system_operation_runner.h | ||
+++ b/storage/browser/fileapi/file_system_operation_runner.h | ||
@@ -53,7 +53,7 @@ class STORAGE_EXPORT FileSystemOperationRunner | ||
using CopyOrMoveOption = FileSystemOperation::CopyOrMoveOption; | ||
using GetMetadataField = FileSystemOperation::GetMetadataField; | ||
|
||
- using OperationID = int; | ||
+ using OperationID = uint64_t; | ||
|
||
virtual ~FileSystemOperationRunner(); | ||
|
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
52 changes: 52 additions & 0 deletions
52
patches/common/v8/do_not_export_private_v8_symbols_on_windows.patch
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,52 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Tomas Rycl <torycl@microsoft.com> | ||
Date: Mon, 13 May 2019 15:48:48 +0200 | ||
Subject: Do not export private V8 symbols on Windows | ||
|
||
This change stops private V8 symbols and internal crt methods being exported. | ||
It fixes an issue where native node modules can import | ||
incorrect CRT methods and crash on Windows. | ||
It also reduces size of node.lib by 75%. | ||
|
||
This patch can be safely removed if, when it is removed, `node.lib` does not | ||
contain any standard C++ library exports (e.g. `std::ostringstream`). | ||
|
||
diff --git a/BUILD.gn b/BUILD.gn | ||
index f43c42a62e1a2d273ece56377c328addb8b99d66..fcf110e673b92070cc1931b376f8a26d38b188e4 100644 | ||
--- a/BUILD.gn | ||
+++ b/BUILD.gn | ||
@@ -212,6 +212,10 @@ config("internal_config") { | ||
|
||
defines = [] | ||
|
||
+ if (!is_component_build && is_electron_build) { | ||
+ defines += [ "HIDE_PRIVATE_SYMBOLS" ] | ||
+ } | ||
+ | ||
if (is_component_build || is_electron_build) { | ||
defines += [ "BUILDING_V8_SHARED" ] | ||
} | ||
diff --git a/src/globals.h b/src/globals.h | ||
index 6edc5d01b4ff503d05d70a7e40959fbc7f972628..d442f691729bd661488018c55e621169cc52ee5e 100644 | ||
--- a/src/globals.h | ||
+++ b/src/globals.h | ||
@@ -20,13 +20,17 @@ | ||
#ifdef V8_OS_WIN | ||
|
||
// Setup for Windows shared library export. | ||
+#if defined(HIDE_PRIVATE_SYMBOLS) | ||
+#define V8_EXPORT_PRIVATE | ||
+#else //if !defined(HIDE_PRIVATE_SYMBOLS) | ||
#ifdef BUILDING_V8_SHARED | ||
#define V8_EXPORT_PRIVATE __declspec(dllexport) | ||
#elif USING_V8_SHARED | ||
#define V8_EXPORT_PRIVATE __declspec(dllimport) | ||
-#else | ||
+#else //!(BUILDING_V8_SHARED || USING_V8_SHARED) | ||
#define V8_EXPORT_PRIVATE | ||
-#endif // BUILDING_V8_SHARED | ||
+#endif | ||
+#endif | ||
|
||
#else // V8_OS_WIN | ||
|
49 changes: 49 additions & 0 deletions
49
patches/common/v8/parser_literalbuffer_expandbuffer_always_grows.patch
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,49 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Toon Verwaest <verwaest@chromium.org> | ||
Date: Fri, 11 Jan 2019 11:27:18 +0100 | ||
Subject: [parser] LiteralBuffer::ExpandBuffer always grows | ||
|
||
Bug: chromium:914736 | ||
Change-Id: Id02715b69361d15df23c70f85f3250526369547f | ||
Reviewed-on: https://chromium-review.googlesource.com/c/1405859 | ||
Reviewed-by: Leszek Swirski <leszeks@chromium.org> | ||
Commit-Queue: Toon Verwaest <verwaest@chromium.org> | ||
Cr-Commit-Position: refs/heads/master@{#58734} | ||
|
||
diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc | ||
index 852b5e400b3ffe84e464a2d63c943a30b497ac69..267b38fd7fed38421b9b6e315b02771dbab9381f 100644 | ||
--- a/src/parsing/scanner.cc | ||
+++ b/src/parsing/scanner.cc | ||
@@ -67,13 +67,14 @@ Handle<String> Scanner::LiteralBuffer::Internalize(Isolate* isolate) const { | ||
} | ||
|
||
int Scanner::LiteralBuffer::NewCapacity(int min_capacity) { | ||
- int capacity = Max(min_capacity, backing_store_.length()); | ||
- int new_capacity = Min(capacity * kGrowthFactory, capacity + kMaxGrowth); | ||
- return new_capacity; | ||
+ return min_capacity < (kMaxGrowth / (kGrowthFactor - 1)) | ||
+ ? min_capacity * kGrowthFactor | ||
+ : min_capacity + kMaxGrowth; | ||
} | ||
|
||
void Scanner::LiteralBuffer::ExpandBuffer() { | ||
- Vector<byte> new_store = Vector<byte>::New(NewCapacity(kInitialCapacity)); | ||
+ int min_capacity = Max(kInitialCapacity, backing_store_.length()); | ||
+ Vector<byte> new_store = Vector<byte>::New(NewCapacity(min_capacity)); | ||
MemCopy(new_store.start(), backing_store_.start(), position_); | ||
backing_store_.Dispose(); | ||
backing_store_ = new_store; | ||
diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h | ||
index 34da5fafbf733fd326e91baeeac26bf4517c9fcf..d779317c55567311dc266af101815d2740d28e0b 100644 | ||
--- a/src/parsing/scanner.h | ||
+++ b/src/parsing/scanner.h | ||
@@ -453,8 +453,7 @@ class Scanner { | ||
|
||
private: | ||
static const int kInitialCapacity = 16; | ||
- static const int kGrowthFactory = 4; | ||
- static const int kMinConversionSlack = 256; | ||
+ static const int kGrowthFactor = 4; | ||
static const int kMaxGrowth = 1 * MB; | ||
|
||
inline bool IsValidAscii(char code_unit) { |
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