strip segfaults on dietlibc-built executables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
binutils |
Fix Released
|
Medium
|
|||
binutils (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bug Description
Binary package hint: dietlibc
On Ubuntu intrepid on amd64, executables built with dietlibc can cause strip to segfault:
$ cat test.c
#include <stdio.h>
int main() { fprintf(stderr, "hello\n"); return 0; }
$ diet gcc test.c -o test
/usr/lib/
stderr.
$ objdump -p test
test: file format elf64-x86-64
Program Header:
LOAD off 0x0000000000000000 vaddr 0x0000000000400000 paddr 0x0000000000400000 align 2**21
filesz 0x0000000000000930 memsz 0x0000000000000930 flags r-x
LOAD off 0x0000000000000ff0 vaddr 0x0000000000600ff0 paddr 0x0000000000600ff0 align 2**21
filesz 0x0000000000000118 memsz 0x0000000000001290 flags rw-
STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags rwx
RELRO off 0x0000000000000ff0 vaddr 0x0000000000600ff0 paddr 0x0000000000600ff0 align 2**0
filesz 0x0000000000000010 memsz 0x0000000000000010 flags r--
$ ./test
hello
$ strip test
Segmentation fault (core dumped)
$ dpkg -s dietlibc-dev | grep ^Version
Version: 0.31-1ubuntu3
$ dpkg -s binutils | grep ^Version
Version: 2.18.50.
I am not sure if the presence of the RELRO segment is correct, because I don't think it has appeared in the i386 version of the executable or in dietlibc executables built on earlier versions of Ubuntu.
Related branches
Changed in binutils: | |
status: | Unknown → Fix Released |
Changed in binutils: | |
importance: | Unknown → Medium |
This change to gcc may be relevant:
gcc-4.3 (4.3.0-3ubuntu5) intrepid; urgency=low security- default: use -Wformat -Wformat-security by default. source- default: use -D_FORTIFY_SOURCE=2 by default.
* debian/rules.patch: add security hardening compiler options:
- gcc-relro-default: use -Wl,-z,relro by default.
- gcc-format-
- gcc-fortify-
-- Kees Cook < <email address hidden>> Thu, 01 May 2008 15:04:12 -0700