ports/devel/electron33/files/patch-v8_src_execution_isolate.cc
Hiroki Tagato a484f0f746 devel/electron33: update to 33.2.1
Changelog: https://github.com/electron/electron/releases/tag/v33.2.1

Reported by:	GitHub (watch releases)
Security:	8b6e97a9-804e-4366-9f75-d102b22a716d
2024-12-03 17:42:18 +09:00

27 lines
982 B
C++

--- v8/src/execution/isolate.cc.orig 2024-12-01 11:21:29 UTC
+++ v8/src/execution/isolate.cc
@@ -168,6 +168,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_[];
@@ -4972,6 +4976,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());