sys-cluster/dyninst: no W+X sections

Closes: https://bugs.gentoo.org/806268
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri 2021-09-04 00:26:09 +02:00
parent 96b9ec6fa1
commit 40ed7d92f4
No known key found for this signature in database
GPG Key ID: 4E4140121372C837
2 changed files with 22 additions and 0 deletions

View File

@ -29,6 +29,8 @@ RDEPEND="
DEPEND="${RDEPEND}"
BDEPEND="doc? ( dev-texlive/texlive-latex )"
PATCHES=( "${FILESDIR}/${P}-remove-executable-flag-from-dyninst_heap-section.patch" )
src_configure() {
local mycmakeargs=(
-DENABLE_STATIC_LIBS=NO

View File

@ -0,0 +1,20 @@
From f27f96cee0b73f770cf69cb98a5744f769014ee5 Mon Sep 17 00:00:00 2001
From: "James A. Kupsch" <kupsch@cs.wisc.edu>
Date: Mon, 30 Aug 2021 10:18:17 -0500
Subject: [PATCH] remove executable flag from .dyninst_heap section
This prevents the library/object with this code from having a segment violates
the W^X security property for segments as the current setting resulted in
segment with both the WRITE and EXECUTE flags set. The function
mark_heaps_exec() restores execute protection to just the heap arrays.
--- a/dyninstAPI_RT/src/RTspace.S
+++ b/dyninstAPI_RT/src/RTspace.S
@@ -8,7 +8,7 @@
.type DYNINSTstaticHeap_16M_anyHeap_1, @object
.size DYNINSTstaticHeap_16M_anyHeap_1, 16777216
-.section .dyninst_heap,"awx",@nobits
+.section .dyninst_heap,"aw",@nobits
.align 16
DYNINSTstaticHeap_512K_lowmemHeap_1:
.skip 524288