Bug 76289

Summary: [PATCH] build: avoid executable stack
Product: kmscon Reporter: Lubomir Rintel <lkundrak>
Component: kmsconAssignee: David Herrmann <dh.herrmann>
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Suggested fox

Description Lubomir Rintel 2014-03-17 19:33:08 UTC
Created attachment 95966 [details]
Suggested fox

-z execstack alone is not sufficient for proper .note.GNU-stack to be generated
when converting from binary, at the very least with binutils-2.23.2 and
elf-x86_64. We need to ensure the section actually gets included.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 1 David Herrmann 2014-03-24 09:19:14 UTC
Ugh, that's weird. I verified that 'ld' includes the .note.GNU-stack section when I wrote that stuff. I wonder which version started dropping it.

I feel a bit worried to mess with gnu-ld implementation details like .note.GNU-stack, but I guess for backwards-compat this should always keep working. Anyhow, I think we should really report that upstream or at least get some comment why "-z execstack" does _not_ force a .note.GNU-stack section?
Comment 2 David Herrmann 2014-03-24 09:42:51 UTC
I reported it upstream as:
  https://sourceware.org/bugzilla/show_bug.cgi?id=16744

If nobody comments on that for the next week, I will apply your workaround. Thanks!
Comment 3 David Herrmann 2014-03-27 17:30:27 UTC
Looks like this will be fixed upstream. Therefore, the right fix is to apply the discussed patch to binutils instead of fixing kmscon. I will close this bug-report. I am tracking the upstream patch and if someone NACKs it, I will fix kmscon respectively.

Thanks for the report!

For the sake of completeness, here's the upstream link again: https://sourceware.org/bugzilla/show_bug.cgi?id=16744

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.