Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 258311 - dev-java/sun-jdk-1.6.0.12 is missing GNU_STACK program header, results in firefox crash
Summary: dev-java/sun-jdk-1.6.0.12 is missing GNU_STACK program header, results in fir...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 263169 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-09 10:47 UTC by PaX Team
Modified: 2011-01-19 11:24 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description PaX Team 2009-02-09 10:47:38 UTC
it seems that all the .so files under /opt/sun-jdk-1.6.0.12/jre/ are missing the GNU_STACK program header. this in turn will cause ld.so to try to make the stack executable whenever a process dlopen's such a library, say, when firefox loads the java plugin. now due to yet another bug in ld.so, the variable holding the current stack protection value (__stack_prot) is in the relro segment and hence ld.so will trigger a segfault when it tries to update this (now read-only) variable.

Reproducible: Always
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2009-02-09 10:59:23 UTC
There's not much we can do to upstream binaries. Please report the issue to http://bugs.sun.com and post a link back here. Please check if icedtea6-bin has these headers as that is something we build ourselves.
Comment 2 PaX Team 2009-02-09 12:40:47 UTC
actually, in this case you can ;), execstack -c will add a GNU_STACK header to the libraries. but that's only a workaround indeed, upstream should pay better attention. unfortunately i already spent enough time on this, so someone else please take it up with Sun (and there's the related glibc/ld.so bug too).
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-03-21 01:12:01 UTC
*** Bug 263169 has been marked as a duplicate of this bug. ***
Comment 4 Alistair Bush (RETIRED) gentoo-dev 2010-03-10 08:26:50 UTC
Pax team,  could we have the defect re-evaluated?  Does this still occur and if not can we close this defect?

Have could I, the town idiot, determine whether a *.so has GNU_STACK?
Comment 5 PaX Team 2010-03-10 09:35:11 UTC
(In reply to comment #4)
> Pax team,  could we have the defect re-evaluated?  Does this still occur and if
> not can we close this defect?

nothing's got fixed apparently, at least not with sun-jdk-1.6.0.18.

> Have could I, the town idiot, determine whether a *.so has GNU_STACK?

it's very simple, you have two ways:

1. scanelf -eqR -E ET_DYN /opt/sun-jdk-1.6.0.18/

   this will produce something like this:

   TYPE   STK/REL/PTL FILE
  ET_DYN --- --- RW- sun-jdk-1.6.0.18/jre/lib/i386/libjava_crw_demo.so

  where the --- under STK means that the GNU_STACK header is missing.

2. find  /opt/sun-jdk-1.6.0.18/ -name *.so -exec readelf -l {} \;

   this will dump the program headers of all .so files, the missing GNU_STACK will be obvious.

the second form can be used to fix it up as well (in the ebuild):

   find  /opt/sun-jdk-1.6.0.18/ -name *.so -exec execstack -c {} \;
Comment 6 Miroslav Šulc gentoo-dev 2011-01-19 03:52:45 UTC
none of the mentioned version is in tree anymore. please reopen if the problem still persists with the versions that are in tree.
Comment 7 Hugo Mildenberger 2011-01-19 11:24:38 UTC
(In reply to comment #6)
> none of the mentioned version is in tree anymore. please reopen if the problem
> still persists with the versions that are in tree.
> 

This problem had been "fixed" the usual way:

scanelf /opt/sun-jdk-1.6.0.23/bin/*|head
 TYPE   FILE 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/appletviewer 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/apt 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/extcheck 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/idlj 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/jar 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/jarsigner 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/java 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/javac 
ET_EXEC /opt/sun-jdk-1.6.0.23/bin/javadoc