ports/devel/electron32/files/patch-v8_src_execution_isolate.cc
Hiroki Tagato 0deb68b9a6 devel/electron32: update to 32.2.2
Changelog: https://github.com/electron/electron/releases/tag/v32.2.2

Reported by:	GitHub (watch releases)
MFH:		2024Q4
Security:	cc068959-ce2b-42eb-81ed-055551fe0e51
2024-10-24 20:31:43 +09:00

27 lines
982 B
C++

--- v8/src/execution/isolate.cc.orig 2024-10-23 20:48:51 UTC
+++ v8/src/execution/isolate.cc
@@ -159,6 +159,10 @@
#include "src/execution/simulator-base.h"
#endif
+#if defined(V8_OS_OPENBSD)
+#include <sys/mman.h>
+#endif
+
extern "C" const uint8_t v8_Default_embedded_blob_code_[];
extern "C" uint32_t v8_Default_embedded_blob_code_size_;
extern "C" const uint8_t v8_Default_embedded_blob_data_[];
@@ -4835,6 +4839,13 @@ void Isolate::InitializeDefaultEmbeddedBlob() {
uint32_t code_size = DefaultEmbeddedBlobCodeSize();
const uint8_t* data = DefaultEmbeddedBlobData();
uint32_t data_size = DefaultEmbeddedBlobDataSize();
+
+#if defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
+ if (code_size > 0) {
+ mprotect(reinterpret_cast<void *>(const_cast<uint8_t *>(code)),
+ code_size, PROT_READ | PROT_EXEC);
+ }
+#endif
if (StickyEmbeddedBlobCode() != nullptr) {
base::MutexGuard guard(current_embedded_blob_refcount_mutex_.Pointer());