Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --noexecstack for assembly code #34

Merged
merged 1 commit into from
Dec 22, 2013

Conversation

nalimilan
Copy link
Contributor

This enables hardware stack protection, which is required by distributions.
See https://wiki.gentoo.org/wiki/Project:Hardened/GNU_stack_quickstart

I found this problem when checking my RPM package of Julia.
The other solution suggested by the above page is to add code to every
.S file:
.section .note.GNU-stack,"",%progbits

They consider it a better approach for upstreaming, but AFAICT there
is not difference with always passing the flags, and this avoids
much duplicated blocks in many files.

This seems to be supported on all architectures now (see link), but
I have no idea what happens with compilers other than gcc.

@ViralBShah
Copy link
Member

Cc: @vtjnash @loladiro

@vtjnash
Copy link
Contributor

vtjnash commented Dec 13, 2013

I have no knowledge / opinion of this.

Reading the link, they seem pretty strongly in favor of patching the source
over passing compiler flags. I would be fine with adding this to all files,
as suggested by the link:


#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

On Thu, Dec 12, 2013 at 11:56 PM, Viral B. Shah notifications@github.comwrote:

Cc: @vtjnash https://github.com/vtjnash @loladirohttps://github.com/loladiro


Reply to this email directly or view it on GitHubhttps://github.com//pull/34#issuecomment-30487174
.

@ViralBShah
Copy link
Member

It seems better to just adding that section to all the files, in that case.

@nalimilan
Copy link
Contributor Author

Here you go. This solution is a little noisy, but indeed it ensures somebody copying the files will not forget to enable stack protection.

@vtjnash
Copy link
Contributor

vtjnash commented Dec 21, 2013

lgtm

ViralBShah added a commit that referenced this pull request Dec 22, 2013
Use --noexecstack for assembly code
@ViralBShah ViralBShah merged commit 8d24a24 into JuliaMath:master Dec 22, 2013
@nalimilan nalimilan deleted the noexecstack branch December 22, 2013 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants