Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 193222
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Sound Team <sound@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Samuli Suominen <ssuominen@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
flac-1.2.1-pic-fix.patch textrel fix for flac patch PaX Team 2007-09-20 21:01 0000 8.79 KB Details | Diff
flac-1.2.1-pic-fix.patch updated patch patch PaX Team 2007-09-27 23:13 0000 2.78 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 193222 depends on: Show dependency tree
Bug 193222 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-09-20 18:36 0000
* 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/media-libs/flac-1.2.1/temp/scanelf-textrel.log
 * TEXTREL usr/lib/libFLAC.so.8.2.0

  libFLAC.so.8.2.0: FLAC__crc16_table [0x35343] in (optimized out: previous
FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap) [0x352C0]
  libFLAC.so.8.2.0: FLAC__crc16_table [0x353E0] in (optimized out: previous
FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap) [0x352C0]
  libFLAC.so.8.2.0: FLAC__crc16_table [0x3553D] in (optimized out: previous
FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap) [0x352C0]
  libFLAC.so.8.2.0: bitreader_read_from_client_ [0x3547C] in (optimized out:
previous FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap) [0x352C0]
  libFLAC.so.8.2.0: bitreader_read_from_client_ [0x354D1] in (optimized out:
previous FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap) [0x352C0]
  /usr/lib/libFLAC.so.8.2.0

I've worked this around for hardened in flac-1.2.1 ebuild by disabling the
broken asm.

Definately should be fixed.

------- Comment #1 From solar 2007-09-20 19:13:59 0000 -------
thanks. I had to fix one small but important thing.

Using commit message:
------------------------------------------------------------------------------
- fix improper use of hardened flag when pic flag should be used
------------------------------------------------------------------------------

/var/cvsroot/gentoo-x86/media-libs/flac/ChangeLog,v  <--  ChangeLog
new revision: 1.119; previous revision: 1.118
/var/cvsroot/gentoo-x86/media-libs/flac/flac-1.2.1.ebuild,v  <-- 
flac-1.2.1.ebuild
new revision: 1.2; previous revision: 1.1

----

In reality because this textrel is in a lib.so this should be 
fixed properly as this version is introducing a regression system wide.

------- Comment #2 From PaX Team 2007-09-20 21:01:06 0000 -------
Created an attachment (id=131458) [details]
textrel fix for flac

how about this one?

------- Comment #3 From Samuli Suominen 2007-09-23 07:22:02 0000 -------
(In reply to comment #2)
> Created an attachment (id=131458) [edit] [details]
> textrel fix for flac
> 
> how about this one?
> 

Thanks, but this causes gst-plugins-flac and flac123 to segfault.. 

FEATURES="nostrip" CFLAGS="-ggdb3" USE="debug" emerge -1 media-libs/flac

gdb flac123

GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run 10.flac
Starting program: /usr/bin/flac123 10.flac
(no debugging symbols found)
(no debugging symbols found)
flac123 version 0.0.11   'flac123 --help' for more info
CPU info (IA-32):
  CPUID ...... Y
  BSWAP ...... Y
  CMOV ....... Y
  MMX ........ Y
  FXSR ....... Y
  SSE ........ Y
  SSE2 ....... n
  SSE3 ....... n
  SSSE3 ...... n
  3DNow! ..... Y
  3DNow!-ext . Y
  3DNow!-MMX . Y
  SSE OS sup . Y

Title  : 10 - Johnny Cash & June Carter Artist: Johnny Cash                   
Album  :                                Year  :     
Comment:                                Genre :                               

Playing FLAC stream from 10.flac
16 bit, 44100 Hz, 2 channels, 7751016 total samples, 175.76 total seconds
error handler called!
error handler called!
error handler called!
error handler called!

Program received signal SIGSEGV, Segmentation fault.
0xb7f6c900 in bitreader_read_from_client_@plt () from /usr/lib/libFLAC.so.8
(gdb) bt
#0  0xb7f6c900 in bitreader_read_from_client_@plt () from /usr/lib/libFLAC.so.8
#1  0xb7fa26b5 in FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap.read2
() from /usr/lib/libFLAC.so.8
#2  0x0824f460 in ?? ()
#3  0x00000019 in ?? ()
#4  0x00000007 in ?? ()
#5  0x00000009 in ?? ()
#6  0xb7fa24a0 in ?? () from /usr/lib/libFLAC.so.8
#7  0xb7fadff4 in ?? () from /usr/lib/libFLAC.so.8
#8  0xbfd607d8 in ?? ()
#9  0xb7f906b7 in read_residual_partitioned_rice_ (decoder=0x800,
predictor_order=0, partition_order=2047, 
    partitioned_rice_contents=0x19, residual=0x5d52, is_extended=0) at
stream_decoder.c:2753
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

------- Comment #4 From PaX Team 2007-09-27 23:13:47 0000 -------
Created an attachment (id=132050) [details]
updated patch

i forgot that the plt stubs also need ebx to be set up, let's try another
approach.

------- Comment #5 From Samuli Suominen 2007-09-28 13:04:11 0000 -------
(In reply to comment #4)
> Created an attachment (id=132050) [edit] [details]
> updated patch
> 
> i forgot that the plt stubs also need ebx to be set up, let's try another
> approach.
> 

works fine, committed it to ~arch in flac-1.2.1-r1

thanks :)

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug