default mmap_min_addr for arm64 prevents running arm32 applications

Bug #1415481 reported by Riku Voipio
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
procps (Ubuntu)
Fix Released
Undecided
Adam Conrad
Trusty
Fix Released
Undecided
Adam Conrad
Utopic
Fix Released
Undecided
Adam Conrad

Bug Description

[ SRU Justification ]
Executing 32-bit arm binaries as user fails on arm64. Turns out, this is bad.

[ Test Case ]
Grab a 32-bit binary (either multiarch via armhf, or compile a quick static hello) and try to run it. Also, check /proc/sys/vm/mmap_min_addr is set to 32k instead of 64k after boot.

[ Regression Potential ]
Shouldn't be any issue with 4k pagesize kernels, and this was already the default on 32-bit ARM for the same reasons. It could, potentially, mean that the zero page is no longer entirely protected from mmap when running a 64k pagesize kernel, however we don't currently ship such a kernel, preferring instead to have 32-bit compatibility.

[ Original Bug Report ]
Executing 32-bit arm binaries as user fails on arm64:

# file hello
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV),
statically linked, for GNU/Linux 2.6.32,
BuildID[sha1]=c37a3b366d645eee600963a535370fa0bad9b2c0, not stripped
# ./hello
hello world
# su - linaro
$ /root/hello
Segmentation fault

Root cause was identified to /etc/sysctl.d/10-zeropage.conf, which is set on arm64 to 65536. To run legacy binaries, this should be set to 32768 like on armhf anr armel.

Reference discussion:

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/320454.html

Affects trusty, utopic and vivid

Adam Conrad (adconrad)
Changed in procps (Ubuntu):
assignee: nobody → Adam Conrad (adconrad)
Changed in procps (Ubuntu Trusty):
assignee: nobody → Adam Conrad (adconrad)
Changed in procps (Ubuntu Utopic):
assignee: nobody → Adam Conrad (adconrad)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package procps - 1:3.3.9-1ubuntu7

---------------
procps (1:3.3.9-1ubuntu7) vivid; urgency=medium

  * Copy 10-zeropage.conf.armhf to 10-zeropage.conf.arm64 (LP: #1415481)
 -- Adam Conrad <email address hidden> Wed, 28 Jan 2015 10:17:09 -0700

Changed in procps (Ubuntu):
status: New → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote :

Fixed packages in the queue and waiting approval for utopic and trusty.

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Riku, or anyone else affected,

Accepted procps into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/procps/1:3.3.9-1ubuntu5.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in procps (Ubuntu Utopic):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Riku, or anyone else affected,

Accepted procps into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/procps/1:3.3.9-1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in procps (Ubuntu Trusty):
status: New → Fix Committed
Revision history for this message
Will Newton (will-newton) wrote :

Newer versions of binutils should start ARM binaries at a higher start address to address this issue in a general way.

Revision history for this message
Riku Voipio (riku-voipio) wrote :

Hi Brian,

I've installed the procps package on trusty arm64 machine, rebooted and verified the correct value is set in /proc/sys/vm/mmap_min_addr. I haven't tested on utopic but see no reason why it wouldn't work there as well.

Riku

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [procps/utopic] possible regression found

As a part of the Stable Release Updates quality process a search for Launchpad bug reports using the version of procps from utopic-proposed was performed and bug 1416210 was found. Please investigate this bug report to ensure that a regression will not be created by this SRU. In the event that this is not a regression remove the "verification-failed" tag from this bug report and tag 1416210 "bot-stop-nagging". Thanks!

tags: added: verification-failed
tags: added: verification-done-trusty
removed: verification-failed
Mathew Hodson (mhodson)
tags: added: verification-needed-utopic
removed: verification-needed
Revision history for this message
William Grant (wgrant) wrote :

I've done multiple armhf builds on both trusty and utopic arm64 with the -proposed package, and everything seems happy.

tags: added: verification-done
removed: verification-done-trusty verification-needed-utopic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package procps - 1:3.3.9-1ubuntu2.1

---------------
procps (1:3.3.9-1ubuntu2.1) trusty; urgency=medium

  * Copy 10-zeropage.conf.armhf to 10-zeropage.conf.arm64 (LP: #1415481)
 -- Adam Conrad <email address hidden> Wed, 28 Jan 2015 10:17:09 -0700

Changed in procps (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for procps has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package procps - 1:3.3.9-1ubuntu5.1

---------------
procps (1:3.3.9-1ubuntu5.1) utopic; urgency=medium

  * Copy 10-zeropage.conf.armhf to 10-zeropage.conf.arm64 (LP: #1415481)
 -- Adam Conrad <email address hidden> Wed, 28 Jan 2015 10:17:09 -0700

Changed in procps (Ubuntu Utopic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.