Summary: | mpost from tetex and (soon to be comitted) texlive gets killed by hardened kernel | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alexis Ballier <aballier> |
Component: | Hardened | Assignee: | The Gentoo Linux Hardened Team <hardened> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anton.kochkov, atoth, Hugo.Mildenberger, jamesb.fe80, jeremyhu, nail2001, navid.zamani, tex |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
We use the C code when __PIC__ is defined
Use C code when -fPIC and on x86 |
Description
Alexis Ballier
![]() What I did not notice at first: * QA Notice: The following files contain runtime text relocations * Text relocations force the dynamic linker to perform extra * work at startup, waste system resources, and may pose a security * risk. On some architectures, the code may not even function * properly, if at all. * For more information, see http://hardened.gentoo.org/pic-fix-guide.xml * Please include this file in your report: * /var/tmp/portage/app-text/texlive-core-2007-r11/temp/scanelf-textrel.log * TEXTREL usr/bin/mpost TEXTREL usr/bin/mf TEXTREL usr/bin/mf-nowin that reminds me the ocaml stuff... I'll investigate it. *** Bug 263986 has been marked as a duplicate of this bug. *** I had a similar problem with '/usr/bin/mf-nowin'. I solved it by running 'paxctl -m' as a sufficiently elevated account. (requires kernel soft mode support) I had a hack that'd paxctl binaries before install, but the maintainers said to fix the software not add more hacks. This is fairly important... any ETA on a real fix? Do we still have the probs in app-text/texlive-core-2009? on amd64 i don't see any textrel and x86 should be clean to. jasmin / # scanelf -a usr/bin/mpost TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- - - NOW usr/bin/mpost jasmin / # scanelf -a usr/bin/mf TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- - - NOW usr/bin/mf jasmin / # scanelf -a usr/bin/mf-nowin TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- - - NOW usr/bin/mf-nowin (In reply to comment #5) > Do we still have the probs in app-text/texlive-core-2009? > on amd64 i don't see any textrel and x86 should be clean to. while it does not get killed on x86 anymore, there might still be an issue of a TEXTRELs :( see below (same version texlive-core-2009 used): g44_x86 ~ # scanelf -a /usr/bin/mpost TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- - - NOW /usr/bin/mpost g44_x86 ~ # scanelf -a /usr/bin/mf TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- TEXTREL - NOW /usr/bin/mf g44_x86 ~ # scanelf -a /usr/bin/mf-nowin TYPE PAX PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE ET_DYN ---xe- 0755 LE RW- R-- RW- TEXTREL - NOW /usr/bin/mf-nowin g44_x86 ~ # scanelf -T /usr/bin/mf TYPE TEXTRELS FILE mf: aritherror [0x7B01] in (optimized out: previous _init) [0x74B8] mf: aritherror [0x7B9A] in (optimized out: previous _init) [0x74B8] ET_DYN /usr/bin/mf g44_x86 ~ # scanelf -T /usr/bin/mf-nowin TYPE TEXTRELS FILE mf-nowin: aritherror [0x7B01] in (optimized out: previous _init) [0x74B8] mf-nowin: aritherror [0x7B9A] in (optimized out: previous _init) [0x74B8] ET_DYN /usr/bin/mf-nowin jasmin / # scanelf -qT /var/tmp/portage/app-text/texlive-core-2009-r2/image/usr/bin/mf mf: .L4069 [0x7B01] in (optimized out: previous LL3) [0x7AFA] mf: .L4069 [0x7B9A] in (optimized out: previous LL34) [0x7B93] /var/tmp/portage/app-text/texlive-core-2009-r2/image/usr/bin/mf The asm code look like this in texk/web2c/lib/mfmpi386.asm LL3: movl $0x7fffffff,%eax #ifdef ASM_NEEDS_UNDERSCORE movb $1,_aritherror #else movb $1,aritherror #endif ...... LL34: movl $0x7fffffff,%eax #ifdef ASM_NEEDS_UNDERSCORE movb $1,_aritherror #else movb $1,aritherror #endif objdump -d mf and you get 00007afa <LL3>: 7afa: b8 ff ff ff 7f mov $0x7fffffff,%eax 7aff: c6 05 00 00 00 00 01 movb $0x1,0x0 ..... 00007b93 <LL34>: 7b93: b8 ff ff ff 7f mov $0x7fffffff,%eax 7b98: c6 05 00 00 00 00 01 movb $0x1,0x0 Created attachment 239877 [details, diff]
We use the C code when __PIC__ is defined
This patch fix the textrel. It use the C functions instead of the asm functions, for the asm code is not PIC/PIE friendly writhen and need alot of work to get it work and i not asm coder.
Big thanks for the fix! How I hate TEXTRELs... *** Bug 371685 has been marked as a duplicate of this bug. *** Created attachment 281455 [details, diff]
Use C code when -fPIC and on x86
New patch that is sended to the tex-live ml
*** Bug 295451 has been marked as a duplicate of this bug. *** Until this is properly fixed upstream, is it possible to get the patch included in the gentoo version of texlive? Currently it prevents building the stable version of texlive-basic on gentoo hardened x86. Thanks http://tug.org/svn/texlive?view=revision&revision=23365 Added upstream. tex@gentoo okay to add patch to tree? (In reply to comment #14) > http://tug.org/svn/texlive?view=revision&revision=23365 > Added upstream. > tex@gentoo okay to add patch to tree? i'll do it; but once i get a more reliable internet access meanwhile you can add it to the patchset in gentoo/src/patchsets cvs tree if you manage to get your way through it and dont break the quilt stuff (the series file) so that i'll just have to validate it and make a new tarball *** Bug 379179 has been marked as a duplicate of this bug. *** fixed in stable and ~arch; ~arch version revbumped, stable not, thanks for the patch! |