pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   nia
Date:           Fri Nov  6 12:15:54 UTC 2020

Modified Files:
        pkgsrc/games/love010: Makefile options.mk
        pkgsrc/games/love09: Makefile options.mk
        pkgsrc/games/love11: Makefile options.mk
        pkgsrc/lang/LuaJIT2: Makefile distinfo
        pkgsrc/www/luakit: Makefile options.mk
Added Files:
        pkgsrc/lang/LuaJIT2/patches: patch-src_lj__ccallback.c
            patch-src_lj__mcode.c

Log Message:
Make luajit PaX MPROTECT safe.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/games/love010/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/games/love010/options.mk
cvs rdiff -u -r1.7 -r1.8 pkgsrc/games/love09/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/games/love09/options.mk
cvs rdiff -u -r1.3 -r1.4 pkgsrc/games/love11/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/games/love11/options.mk
cvs rdiff -u -r1.15 -r1.16 pkgsrc/lang/LuaJIT2/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/lang/LuaJIT2/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/LuaJIT2/patches/patch-src_lj__ccallback.c \
    pkgsrc/lang/LuaJIT2/patches/patch-src_lj__mcode.c
cvs rdiff -u -r1.6 -r1.7 pkgsrc/www/luakit/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/www/luakit/options.mk

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

Modified files:

Index: pkgsrc/games/love010/Makefile
diff -u pkgsrc/games/love010/Makefile:1.7 pkgsrc/games/love010/Makefile:1.8
--- pkgsrc/games/love010/Makefile:1.7   Tue Aug 18 17:57:55 2020
+++ pkgsrc/games/love010/Makefile       Fri Nov  6 12:15:54 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2020/08/18 17:57:55 leot Exp $
+# $NetBSD: Makefile,v 1.8 2020/11/06 12:15:54 nia Exp $
 
 DISTNAME=      love-0.10.2-linux-src
 PKGNAME=       ${DISTNAME:S/-linux-src//:S/love/love010/}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    games lua
 MASTER_SITES=  https://bitbucket.org/rude/love/downloads/
 

Index: pkgsrc/games/love010/options.mk
diff -u pkgsrc/games/love010/options.mk:1.3 pkgsrc/games/love010/options.mk:1.4
--- pkgsrc/games/love010/options.mk:1.3 Sun Jun 28 09:29:16 2020
+++ pkgsrc/games/love010/options.mk     Fri Nov  6 12:15:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2020/06/28 09:29:16 nia Exp $
+# $NetBSD: options.mk,v 1.4 2020/11/06 12:15:54 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.love
 
@@ -12,8 +12,6 @@ PKG_SUGGESTED_OPTIONS=        luajit
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Mluajit)
-# JIT needs WX mappings
-NOT_PAX_MPROTECT_SAFE+=                love0.10/bin/love
 .  include "../../lang/LuaJIT2/buildlink3.mk"
 .else
 CONFIGURE_ARGS+=               --with-lua=lua

Index: pkgsrc/games/love09/Makefile
diff -u pkgsrc/games/love09/Makefile:1.7 pkgsrc/games/love09/Makefile:1.8
--- pkgsrc/games/love09/Makefile:1.7    Tue Aug 18 17:57:55 2020
+++ pkgsrc/games/love09/Makefile        Fri Nov  6 12:15:54 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2020/08/18 17:57:55 leot Exp $
+# $NetBSD: Makefile,v 1.8 2020/11/06 12:15:54 nia Exp $
 
 DISTNAME=      love-0.9.2-linux-src
 PKGNAME=       ${DISTNAME:S/-linux-src//:S/love/love09/}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    games lua
 MASTER_SITES=  https://bitbucket.org/rude/love/downloads/
 

Index: pkgsrc/games/love09/options.mk
diff -u pkgsrc/games/love09/options.mk:1.1 pkgsrc/games/love09/options.mk:1.2
--- pkgsrc/games/love09/options.mk:1.1  Wed Jul  1 16:39:58 2020
+++ pkgsrc/games/love09/options.mk      Fri Nov  6 12:15:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2020/07/01 16:39:58 nia Exp $
+# $NetBSD: options.mk,v 1.2 2020/11/06 12:15:54 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.love
 
@@ -12,8 +12,6 @@ PKG_SUGGESTED_OPTIONS=        luajit
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Mluajit)
-# JIT needs WX mappings
-NOT_PAX_MPROTECT_SAFE+=                love0.9/bin/love
 CONFIGURE_ARGS+=               --with-lua=luajit
 .  include "../../lang/LuaJIT2/buildlink3.mk"
 .else

Index: pkgsrc/games/love11/Makefile
diff -u pkgsrc/games/love11/Makefile:1.3 pkgsrc/games/love11/Makefile:1.4
--- pkgsrc/games/love11/Makefile:1.3    Tue Aug 18 17:57:55 2020
+++ pkgsrc/games/love11/Makefile        Fri Nov  6 12:15:54 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2020/08/18 17:57:55 leot Exp $
+# $NetBSD: Makefile,v 1.4 2020/11/06 12:15:54 nia Exp $
 
 DISTNAME=      love-11.3-linux-src
 PKGNAME=       ${DISTNAME:S/-linux-src//:S/love/love11/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    games lua
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=love2d/}
 GITHUB_PROJECT=        love

Index: pkgsrc/games/love11/options.mk
diff -u pkgsrc/games/love11/options.mk:1.1 pkgsrc/games/love11/options.mk:1.2
--- pkgsrc/games/love11/options.mk:1.1  Mon Jun 29 13:04:14 2020
+++ pkgsrc/games/love11/options.mk      Fri Nov  6 12:15:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2020/06/29 13:04:14 nia Exp $
+# $NetBSD: options.mk,v 1.2 2020/11/06 12:15:54 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.love
 PKG_SUPPORTED_OPTIONS= luajit
@@ -11,8 +11,6 @@ PKG_SUGGESTED_OPTIONS=        luajit
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Mluajit)
-# JIT needs WX mappings
-NOT_PAX_MPROTECT_SAFE+=                love11/bin/love
 .  include "../../lang/LuaJIT2/buildlink3.mk"
 .else
 CONFIGURE_ARGS+=               --with-lua=lua

Index: pkgsrc/lang/LuaJIT2/Makefile
diff -u pkgsrc/lang/LuaJIT2/Makefile:1.15 pkgsrc/lang/LuaJIT2/Makefile:1.16
--- pkgsrc/lang/LuaJIT2/Makefile:1.15   Thu Jul  2 10:16:59 2020
+++ pkgsrc/lang/LuaJIT2/Makefile        Fri Nov  6 12:15:53 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.15 2020/07/02 10:16:59 nia Exp $
+# $NetBSD: Makefile,v 1.16 2020/11/06 12:15:53 nia Exp $
 #
 
 DISTNAME=      LuaJIT-2.0.5
 PKGNAME=       ${DISTNAME:S/LuaJIT/LuaJIT2/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang lua
 MASTER_SITES=  http://luajit.org/download/
 
@@ -22,8 +22,6 @@ ONLY_FOR_PLATFORM+=   *-*-mipsel
 ONLY_FOR_PLATFORM+=    *-*-powerpc
 ONLY_FOR_PLATFORM+=    *-*-x86_64
 
-NOT_PAX_MPROTECT_SAFE+=        bin/luajit
-
 # Address pkg/47587 lua not linked to pthread causes issues with modules
 PTHREAD_OPTS+=         native
 PTHREAD_AUTO_VARS=     yes

Index: pkgsrc/lang/LuaJIT2/distinfo
diff -u pkgsrc/lang/LuaJIT2/distinfo:1.10 pkgsrc/lang/LuaJIT2/distinfo:1.11
--- pkgsrc/lang/LuaJIT2/distinfo:1.10   Sat Jun  2 20:01:21 2018
+++ pkgsrc/lang/LuaJIT2/distinfo        Fri Nov  6 12:15:53 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2018/06/02 20:01:21 he Exp $
+$NetBSD: distinfo,v 1.11 2020/11/06 12:15:53 nia Exp $
 
 SHA1 (LuaJIT-2.0.5.tar.gz) = 10427215da7d424fd9e48adbea087966053cdb6f
 RMD160 (LuaJIT-2.0.5.tar.gz) = 5176d34fa112c4586394398c3a5c9ce1ad4d4c72
@@ -7,3 +7,5 @@ Size (LuaJIT-2.0.5.tar.gz) = 849845 byte
 SHA1 (patch-Makefile) = edea30d017c9d2938d951bfdee88020906945aee
 SHA1 (patch-src_Makefile) = d7236260dc17f470d7d6e41a57a22dcd3a501c28
 SHA1 (patch-src_lj__arch.h) = 4c34706db4c678b368bb3e38b07505abde01e590
+SHA1 (patch-src_lj__ccallback.c) = 8032bc451a504ae9538fb0ae4cc1ee729ede3a70
+SHA1 (patch-src_lj__mcode.c) = c150e0b07ab441e983ace21e0e813fd4334290b5

Index: pkgsrc/www/luakit/Makefile
diff -u pkgsrc/www/luakit/Makefile:1.6 pkgsrc/www/luakit/Makefile:1.7
--- pkgsrc/www/luakit/Makefile:1.6      Thu Nov  5 09:09:21 2020
+++ pkgsrc/www/luakit/Makefile  Fri Nov  6 12:15:54 2020
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2020/11/05 09:09:21 ryoon Exp $
+# $NetBSD: Makefile,v 1.7 2020/11/06 12:15:54 nia Exp $
 
 DISTNAME=      luakit-2.2.1
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    www lua
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=luakit/}
 

Index: pkgsrc/www/luakit/options.mk
diff -u pkgsrc/www/luakit/options.mk:1.1 pkgsrc/www/luakit/options.mk:1.2
--- pkgsrc/www/luakit/options.mk:1.1    Sun Aug  9 17:25:37 2020
+++ pkgsrc/www/luakit/options.mk        Fri Nov  6 12:15:54 2020
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2020/08/09 17:25:37 nia Exp $
+# $NetBSD: options.mk,v 1.2 2020/11/06 12:15:54 nia Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.luakit
 PKG_SUPPORTED_OPTIONS=         luajit
@@ -11,7 +11,6 @@ PKG_SUGGESTED_OPTIONS=                luajit
 
 .if !empty(PKG_OPTIONS:Mluajit)
 MAKE_FLAGS+=   USE_LUAJIT=1
-NOT_PAX_MPROTECT_SAFE+=        bin/luakit
 .  include "../../lang/LuaJIT2/buildlink3.mk"
 .else
 MAKE_FLAGS+=   USE_LUAJIT=0

Added files:

Index: pkgsrc/lang/LuaJIT2/patches/patch-src_lj__ccallback.c
diff -u /dev/null pkgsrc/lang/LuaJIT2/patches/patch-src_lj__ccallback.c:1.1
--- /dev/null   Fri Nov  6 12:15:54 2020
+++ pkgsrc/lang/LuaJIT2/patches/patch-src_lj__ccallback.c       Fri Nov  6 12:15:53 2020
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_lj__ccallback.c,v 1.1 2020/11/06 12:15:53 nia Exp $
+
+Make this PaX-MPROTECT safe on NetBSD.
+
+--- src/lj_ccallback.c.orig    2017-05-01 18:11:00.000000000 +0000
++++ src/lj_ccallback.c
+@@ -228,8 +228,12 @@ static void callback_mcode_new(CTState *
+   if (!p)
+     lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);
+ #elif LJ_TARGET_POSIX
+-  p = mmap(NULL, sz, (PROT_READ|PROT_WRITE), MAP_PRIVATE|MAP_ANONYMOUS,
+-         -1, 0);
++#ifdef PROT_MPROTECT
++  p = mmap(NULL, sz, (PROT_READ|PROT_WRITE) | PROT_MPROTECT(PROT_EXEC),
++#else
++  p = mmap(NULL, sz, (PROT_READ|PROT_WRITE),
++#endif
++           MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+   if (p == MAP_FAILED)
+     lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);
+ #else
Index: pkgsrc/lang/LuaJIT2/patches/patch-src_lj__mcode.c
diff -u /dev/null pkgsrc/lang/LuaJIT2/patches/patch-src_lj__mcode.c:1.1
--- /dev/null   Fri Nov  6 12:15:54 2020
+++ pkgsrc/lang/LuaJIT2/patches/patch-src_lj__mcode.c   Fri Nov  6 12:15:53 2020
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_lj__mcode.c,v 1.1 2020/11/06 12:15:53 nia Exp $
+
+Make PaX-MPROTECT safe for NetBSD.
+
+--- src/lj_mcode.c.orig        2017-05-01 18:11:00.000000000 +0000
++++ src/lj_mcode.c
+@@ -99,7 +99,11 @@ static int mcode_setprot(void *p, size_t
+ 
+ static void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot)
+ {
++#ifdef PROT_MPROTECT
++  void *p = mmap((void *)hint, sz, prot | PROT_MPROTECT(MCPROT_RWX), MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
++#else
+   void *p = mmap((void *)hint, sz, prot, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
++#endif
+   if (p == MAP_FAILED) {
+     if (!hint) lj_trace_err(J, LJ_TRERR_MCODEAL);
+     p = NULL;
+@@ -255,7 +259,7 @@ static void *mcode_alloc(jit_State *J, s
+ /* All memory addresses are reachable by relative jumps. */
+ static void *mcode_alloc(jit_State *J, size_t sz)
+ {
+-#ifdef __OpenBSD__
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+   /* Allow better executable memory allocation for OpenBSD W^X mode. */
+   void *p = mcode_alloc_at(J, 0, sz, MCPROT_RUN);
+   if (p && mcode_setprot(p, sz, MCPROT_GEN)) {



Home | Main Index | Thread Index | Old Index