pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/mozjs68



Module Name:    pkgsrc
Committed By:   nia
Date:           Thu Nov  5 16:35:25 UTC 2020

Modified Files:
        pkgsrc/lang/mozjs68: Makefile distinfo
Added Files:
        pkgsrc/lang/mozjs68/patches: patch-jit_ProcessExecutableMemory.cpp

Log Message:
mozjs68: Make PaX-MPROTECT safe on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/lang/mozjs68/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/mozjs68/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/mozjs68/patches/patch-jit_ProcessExecutableMemory.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/mozjs68/Makefile
diff -u pkgsrc/lang/mozjs68/Makefile:1.9 pkgsrc/lang/mozjs68/Makefile:1.10
--- pkgsrc/lang/mozjs68/Makefile:1.9    Thu Nov  5 09:06:57 2020
+++ pkgsrc/lang/mozjs68/Makefile        Thu Nov  5 16:35:24 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2020/11/05 09:06:57 ryoon Exp $
+# $NetBSD: Makefile,v 1.10 2020/11/05 16:35:24 nia Exp $
 
 DISTNAME=      mozjs68_68.6.0.orig
 PKGNAME=       ${DISTNAME:S/_/-/:S/.orig//}
-PKGREVISION=   5
+PKGREVISION=   6
 CATEGORIES=    lang
 MASTER_SITES=  http://deb.debian.org/debian/pool/main/m/mozjs68/
 EXTRACT_SUFX=  .tar.xz
@@ -39,8 +39,6 @@ CONFIGURE_ARGS+=      --host=${MACHINE_GNU_PL
 PKGCONFIG_OVERRIDE+=   build/js.pc.in
 PKGCONFIG_OVERRIDE+=   ctypes/libffi/libffi.pc.in
 
-NOT_PAX_MPROTECT_SAFE+=        bin/js68
-
 # Python 2.7 and Python 3.6 or later are required simultaneously.
 PYTHON_VERSIONS_ACCEPTED=      27
 PYTHON_FOR_BUILD_ONLY=         tool

Index: pkgsrc/lang/mozjs68/distinfo
diff -u pkgsrc/lang/mozjs68/distinfo:1.2 pkgsrc/lang/mozjs68/distinfo:1.3
--- pkgsrc/lang/mozjs68/distinfo:1.2    Thu May 14 08:44:48 2020
+++ pkgsrc/lang/mozjs68/distinfo        Thu Nov  5 16:35:24 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.2 2020/05/14 08:44:48 rin Exp $
+$NetBSD: distinfo,v 1.3 2020/11/05 16:35:24 nia Exp $
 
 SHA1 (mozjs68_68.6.0.orig.tar.xz) = 98eb63629e8889caa738fa15591fe8eeba73b227
 RMD160 (mozjs68_68.6.0.orig.tar.xz) = 7b00f416e1e767b0595fbd7e4c26c42c83ccd7a1
@@ -6,5 +6,6 @@ SHA512 (mozjs68_68.6.0.orig.tar.xz) = fa
 Size (mozjs68_68.6.0.orig.tar.xz) = 75303520 bytes
 SHA1 (patch-.._.._config_rules.mk) = cf3421d991e1cbfab4c0cdcb7b648b1388fa32d5
 SHA1 (patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py) = dda670432e5673c5d28dcf6c4902d4a724e71170
+SHA1 (patch-jit_ProcessExecutableMemory.cpp) = 575c1ab68e6558344c09481927c40f0b4308319a
 SHA1 (patch-vm_JSONPrinter.cpp) = 384f26d9602844a3a586184c8971d48a07453645
 SHA1 (patch-vm_JSONPrinter.h) = b92c335185886f79d15f2d9d348bf10e4a714c6e

Added files:

Index: pkgsrc/lang/mozjs68/patches/patch-jit_ProcessExecutableMemory.cpp
diff -u /dev/null pkgsrc/lang/mozjs68/patches/patch-jit_ProcessExecutableMemory.cpp:1.1
--- /dev/null   Thu Nov  5 16:35:25 2020
+++ pkgsrc/lang/mozjs68/patches/patch-jit_ProcessExecutableMemory.cpp   Thu Nov  5 16:35:25 2020
@@ -0,0 +1,38 @@
+$NetBSD: patch-jit_ProcessExecutableMemory.cpp,v 1.1 2020/11/05 16:35:25 nia Exp $
+
+PaX MPROTECT safety for NetBSD.
+
+--- jit/ProcessExecutableMemory.cpp.orig       2020-03-05 20:56:58.000000000 +0000
++++ jit/ProcessExecutableMemory.cpp
+@@ -343,9 +343,16 @@ static void* ReserveProcessExecutableMem
+   // Note that randomAddr is just a hint: if the address is not available
+   // mmap will pick a different address.
+   void* randomAddr = ComputeRandomAllocationAddress();
++#ifdef PROT_MPROTECT
++  void* p = MozTaggedAnonymousMmap(randomAddr, bytes,
++                                   PROT_MPROTECT(PROT_EXEC | PROT_WRITE | PROT_READ),
++                                   MAP_PRIVATE | MAP_ANON, -1, 0,
++                                   "js-executable-memory");
++#else
+   void* p = MozTaggedAnonymousMmap(randomAddr, bytes, PROT_NONE,
+                                    MAP_PRIVATE | MAP_ANON, -1, 0,
+                                    "js-executable-memory");
++#endif
+   if (p == MAP_FAILED) {
+     return nullptr;
+   }
+@@ -390,8 +397,12 @@ static unsigned ProtectionSettingToFlags
+ 
+ static MOZ_MUST_USE bool CommitPages(void* addr, size_t bytes,
+                                      ProtectionSetting protection) {
+-  void* p = MozTaggedAnonymousMmap(
+-      addr, bytes, ProtectionSettingToFlags(protection),
++  void* p = MozTaggedAnonymousMmap(addr, bytes,
++#ifdef PROT_MPROTECT
++      ProtectionSettingToFlags(protection) | PROT_MPROTECT(PROT_EXEC | PROT_WRITE | PROT_READ),
++#else
++      ProtectionSettingToFlags(protection),
++#endif
+       MAP_FIXED | MAP_PRIVATE | MAP_ANON, -1, 0, "js-executable-memory");
+   if (p == MAP_FAILED) {
+     return false;



Home | Main Index | Thread Index | Old Index