Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1251165 - execstack arch issues in %check for aarch64
Summary: execstack arch issues in %check for aarch64
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: execstack
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARM64, F-ExcludeArch-aarch64
TreeView+ depends on / blocked
 
Reported: 2015-08-06 15:35 UTC by Peter Robinson
Modified: 2015-09-01 03:36 UTC (History)
3 users (show)

Fixed In Version: 0.5.0-9.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-01 03:36:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to add aarch64 bits (4.64 KB, application/mbox)
2015-08-21 16:16 UTC, Mark Salter
no flags Details

Description Peter Robinson 2015-08-06 15:35:20 UTC
prelink never supported aarch64 but the exectstack bits should be just find and in fact they do build.

The issue is in %check where I suspect there's a left over arch specific reminiscefnce from prelink.

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.jQFf6n
+ umask 022
+ cd /builddir/build/BUILD
+ cd prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8
+ cp src/execstack test
+ src/execstack -q test
+ grep '^-'
src/execstack: "test"'s architecture is not supported
error: Bad exit status from /var/tmp/rpm-tmp.jQFf6n (%check)
    Bad exit status from /var/tmp/rpm-tmp.jQFf6n (%check)
RPM build errors:
Child return code was: 1

Full logs: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=3116673

Comment 1 Zbigniew Jędrzejewski-Szmek 2015-08-06 15:57:18 UTC
It's more complicated than that. dso->arch->max_page_size is used in execstack_set(). If aarch64 were to be supported, I think a copy of PL_ARCH should be added.

This is for amd64, the non-prelink bits:
PL_ARCH = {
  .name = "x86-64",
  .class = ELFCLASS64,
  .machine = EM_X86_64,
  .alternate_machine = { EM_NONE },
  ...
  .max_page_size = 0x200000,
  .page_size = 0x1000
};

Comment 2 Peter Robinson 2015-08-20 12:29:49 UTC
Was there a general consensus on this?

Comment 3 Zbigniew Jędrzejewski-Szmek 2015-08-20 13:11:02 UTC
General consensus on what? If you mean the solution proposed in comment #c1, then no, it was only my own opinion. I'm fine with whatever solution, but it would be best if someone from the aarch64 side would implement and test the change. I have very little idea about that architecture.

Comment 4 Peter Robinson 2015-08-20 13:42:29 UTC
Consensus on what the fix is, whether it's c1 or something else. Do I need to get people from the ARM team engaged etc

Comment 5 Zbigniew Jędrzejewski-Szmek 2015-08-20 15:08:21 UTC
The entirety of the discussion is in this ticket.

Comment 6 Mark Salter 2015-08-21 16:16:26 UTC
Created attachment 1065637 [details]
Patch to add aarch64 bits

The attached patch adds enough PL_ARCH bits for aarch64 to make execstack happy. With it and this specfile tweak, aarch64 passes %check.

diff --git a/execstack.spec b/execstack.spec
index d5cb294..0c16560 100644
--- a/execstack.spec
+++ b/execstack.spec
@@ -11,6 +11,8 @@ License: GPLv2+
 # work around for missing upstream tarball with latest checkin
 Source0: https://github.com/keszybz/prelink/archive/%{commit}.tar.gz#/prelink-%{shortcommit}.tar.gz
 
+Patch0: Add-PL_ARCH-for-AArch64.patch
+
 BuildRequires: elfutils-libelf-devel
 BuildRequires: libselinux-devel, libselinux-utils
 Requires: glibc >= 2.2.4-18, coreutils, findutils
@@ -24,7 +26,7 @@ execstack binary. It can be used manipulate ELF binaries to run
 with or without executable stack.
 
 %prep
-%autosetup -n prelink-%{commit}
+%autosetup -n prelink-%{commit} -p1
 
 %build
 sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in}

Comment 7 Fedora Update System 2015-08-21 17:02:59 UTC
execstack-0.5.0-9.fc23 has been submitted as an update to Fedora 23. https://bugzilla.redhat.com/show_bug.cgi?id=1251165

Comment 8 Fedora Update System 2015-08-22 16:24:25 UTC
execstack-0.5.0-9.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update execstack'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-13930

Comment 9 Fedora Update System 2015-09-01 03:36:26 UTC
execstack-0.5.0-9.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.