rspamd is using LuaJIT by default which causes crashes when used with hardened-sources (PaX) This patch adds a "jit" useflag to either compile with lua or luajit -------------------------------------------- --- rspamd-1.1.1.ebuild 2016-01-22 11:01:02.000000000 +0100 +++ rspamd-1.1.1.ebuild 2016-01-23 15:34:28.324240674 +0100 @@ -13,11 +13,12 @@ LICENSE="BSD-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="jit" DEPEND="dev-libs/openssl:0 dev-libs/libpcre - dev-lang/luajit:2 + !jit? ( >=dev-lang/lua-5.1:0 ) + jit? ( dev-lang/luajit:2 ) dev-libs/libevent dev-db/sqlite:3 dev-libs/glib:2 @@ -32,11 +33,16 @@ } src_configure() { + luajit="OFF" + if use jit; then + luajit="ON" + fi local mycmakeargs=( -DCONFDIR=/etc/rspamd -DRUNDIR=/var/run/rspamd -DDBDIR=/var/lib/rspamd -DLOGDIR=/var/log/rspamd + -DENABLE_LUAJIT=${luajit} ) cmake-utils_src_configure } Reproducible: Always
Conditionally also set jit useflag on libpcre ------------------------------------------------ --- rspamd-1.1.1.ebuild 2016-01-22 11:01:02.000000000 +0100 +++ rspamd-1.1.1.ebuild 2016-01-23 17:44:55.822161472 +0100 @@ -13,11 +13,17 @@ LICENSE="BSD-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="jit" DEPEND="dev-libs/openssl:0 - dev-libs/libpcre - dev-lang/luajit:2 + !jit? ( + >=dev-lang/lua-5.1:0 + dev-libs/libpcre[-jit] + ) + jit? ( + dev-lang/luajit:2 + dev-libs/libpcre[jit] + ) dev-libs/libevent dev-db/sqlite:3 dev-libs/glib:2 @@ -32,11 +38,16 @@ } src_configure() { + luajit="OFF" + if use jit; then + luajit="ON" + fi local mycmakeargs=( -DCONFDIR=/etc/rspamd -DRUNDIR=/var/run/rspamd -DDBDIR=/var/lib/rspamd -DLOGDIR=/var/log/rspamd + -DENABLE_LUAJIT=${luajit} ) cmake-utils_src_configure } -------------------------------------------
Created attachment 423692 [details] rspamd-1.1.1-r1.ebuild
Thanks, now rpsmad works on my box with hardened sources. I'm thinking about jit flag, shouldn't it be disabled on pax kernel?
(In reply to Daniel Kenzelmann from comment #0) > + luajit="OFF" > + if use jit; then > + luajit="ON" > + fi > local mycmakeargs=( > -DCONFDIR=/etc/rspamd > -DRUNDIR=/var/run/rspamd > -DDBDIR=/var/lib/rspamd > -DLOGDIR=/var/log/rspamd > + -DENABLE_LUAJIT=${luajit} > ) A quick shortcut is -DENABLE_LUAJIT=$(usex jit).
Hmm, I think the default here should be +jit, so that users get something by default that resembles the upstream preference. Any objections?
What about forcing "-jit" on hardened profile?
Yeah, that seems sane.
Added the jit USE flag as discussed here, in 1.1.1-r1.