please detect and clear executable stack binaries

Bug #1739066 reported by Jamie Strandboge
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

https://forum.snapcraft.io/t/snap-and-executable-stacks/1812 describes the situation with snaps that have executable stacks. It would be great if snapcraft could detect these binaries and clear the execstack bit (but not during the 'snapcraft pack' step, since that shouldn't touch anything) and warn.

Eg:
$ snapcraft
...
WARN: clearing executable stack in 'foo.bin'. See https://forum.snapcraft.io/t/snap-and-executable-stacks/1812 for more information
...

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

In the forum post, you say

"For programs that legitimately require an executable stack when they otherwise work fine in strict mode, the review tools in the Snap Store will allow for overriding the warning and allow the snap to pass automated review."

If we automatically strip it, how can one create a snap that uses it while still taking advantage of snapcraft?

Revision history for this message
Evan (ev) wrote :

This is now proven to affect Electron apps as well:
https://gist.github.com/evandandrea/63bd48524208380261af37db4d556765

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Evan, I feel like you meant to paste a different commit since this isn't doing anything related to execstack AFAICT? Also, while I 100% agree that this bug should be fixed for the short/medium term, I would really like to see electron itself fixed: https://forum.snapcraft.io/t/canvas-createcontext-webgl-returns-null-in-electron/3231/30.

@Kyle - there would have to be an override mechanism in snapcraft. In the meantime, repack with it set back.

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

The mattermost snap is affected by this as well. This issue is very hard to debug, in mattermost it resulted in fonts not loading due to a blocked mmap call when the desktop plug is added..

More info: https://forum.snapcraft.io/t/fonts-fail-to-load-when-desktop-plug-added

Revision history for this message
Evan (ev) wrote :

@Jamie, yes it was the wrong gist. Here's one for soundnode (https://github.com/Soundnode/soundnode-app) before clearing execstack:
https://gist.github.com/anonymous/7fa7fa2b6fb73d605addfa0938063d5d

After clearing it runs just fine.

Revision history for this message
Evan (ev) wrote :

Affects Destroyer (https://github.com/mashaal/destroyer/) as well.

Changed in snapcraft:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: In Progress → 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.