public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libffi/28036] New: libffi executable stack (missing .note.GNU-stack on .o files)
@ 2006-06-15 4:40 nigelenki at comcast dot net
2006-06-15 5:29 ` [Bug libffi/28036] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: nigelenki at comcast dot net @ 2006-06-15 4:40 UTC (permalink / raw)
To: gcc-bugs
I noticed (on ubuntu) that libgcj had an executable stack; tracing this back, I
found that libffi also had an executable stack, and why. pinskia informs me
that libffi gets linked into libgcj so that solves that!
SCANELF:
bluefox@icebox:/tmp/x$ scanelf -qeRt /usr/lib
RWX --- --- /usr/lib/libgcj.so.7.0.0
I built gcc and ran a scanelf on the source tree to find out what was up and
located a few .o files missing .note.GNU-stack
SCANELF:
bluefox@icebox:/tmp/x$ scanelf -qeRt .
RWX --- --- ./gcj-4.1-4.1.0/build/i486-linux-gnu/libffi/.libs/libffi.so.4.0.1
!WX --- --- ./gcj-4.1-4.1.0/build/i486-linux-gnu/libffi/src/x86/sysv.o
!WX --- --- ./gcj-4.1-4.1.0/build/i486-linux-gnu/libffi/src/x86/unix64.o
!WX --- --- ./gcj-4.1-4.1.0/build/i486-linux-gnu/libffi/src/x86/.libs/sysv.o
!WX --- ---
./gcj-4.1-4.1.0/build/i486-linux-gnu/libffi/src/x86/.libs/unix64.o
sysv.o and unix64.o, find them:
FIND:
bluefox@icebox:/tmp/x$ find . -name sysv.S
./gcj-4.1-4.1.0/src/libffi/src/sh/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/cris/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/s390/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/x86/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/m68k/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/sh64/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/m32r/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/arm/sysv.S
./gcj-4.1-4.1.0/src/libffi/src/powerpc/sysv.S
Let's peek in x86:
bluefox@icebox:/tmp/x$ ls gcj-4.1-4.1.0/src/libffi/src/x86/
ffi64.c ffi.c ffitarget.h sysv.S unix64.S win32.S
win32.S can probably be ignored, however...
bluefox@icebox:/tmp/x$ grep -Hnr ".note.GNU-stack" gcj-4.1-4.1.0/src/libffi/
bluefox@icebox:/tmp/x$
The others probably need this block at the end (yanked from [1]):
#ifdef __ELF__
.section .note.GNU-stack,"",%progbits
#endif
No idea if this will clear the executable stack, haven't tested; but it'll
supply a proper .note.GNU-stack segment where it really should be at least.
[1] http://www.gentoo.org/proj/en/hardened/gnu-stack.xml
--
Summary: libffi executable stack (missing .note.GNU-stack on .o
files)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libffi
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nigelenki at comcast dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28036
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-12-13 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-15 4:40 [Bug libffi/28036] New: libffi executable stack (missing .note.GNU-stack on .o files) nigelenki at comcast dot net
2006-06-15 5:29 ` [Bug libffi/28036] " pinskia at gcc dot gnu dot org
2006-06-15 11:31 ` aph at gcc dot gnu dot org
2006-12-13 15:58 ` debian-gcc at lists dot debian dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).