-fstack-protector not enabled by default on ARM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.3 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
gcc-4.4 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: gcc-4.3
The stack protector should be enabled by default on ARM builds. AFAIK, the upstream bugs have been fixed for a while now.
$ make stack-protector-off
gcc -Wall -O2 -U_FORTIFY_SOURCE -o stack-protector-off stack-protector.c -fno-stack-
$ make stack-protector-on
gcc -Wall -O2 -U_FORTIFY_SOURCE -o stack-protector-on stack-protector.c -fstack-protector
$ make stack-protector
gcc -Wall -O2 -U_FORTIFY_SOURCE -o stack-protector
$ ./stack-
Hello! You typed: AAAAAAAAAAAAAAA
Segmentation fault
$ ./stack-
Hello! You typed: AAAAAAAAAAAAAAA
*** stack smashing detected ***: ./stack-
Aborted
$ ./stack-
Hello! You typed: AAAAAAAAAAAAAAA
Segmentation fault
on ARM:
$ gcc -v -Wall -O2 -U_FORTIFY_SOURCE -o stack-protector
/usr/lib/
on i386:
$ gcc -v -Wall -O2 -U_FORTIFY_SOURCE -o stack-protector
/usr/lib/
the former is lacking -fstack-protector
visibility: | private → public |
Changed in gcc-4.3 (Ubuntu): | |
importance: | Undecided → High |
status: | New → Confirmed |
tags: | added: armel |
according to http:// gcc.gnu. org/bugzilla/ show_bug. cgi?id= 35965, this is not fixed for the 4.3 branch.