hardening_patches not enabled for cross builds

Bug #868924 reported by Marcin Juszkiewicz
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gcc-4.6 (Ubuntu)
Fix Released
Undecided
Unassigned
gcc-4.6-armel-cross (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Native gcc-4.x build has hardening_patches enabled but cross one does not. This makes both toolchain generate different results.

Tags: patch
Marcin Juszkiewicz (hrw)
Changed in gcc-4.6 (Ubuntu):
status: New → Confirmed
Changed in gcc-4.6-armel-cross (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

This patch applies hardening patches for cross builds.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "enable-hardening-for-cross.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

hardening should not be enabled in armel-cross-toolchain-base:

root@puchatek:~/armel-cross-toolchain-base-1.76/eglibc-2.13/misc# arm-linux-gnueabi-gcc ../sysdeps/unix/sysv/linux/syslog.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -fstrict-aliasing -g -pipe -Wstrict-prototypes -fexceptions -I../include -I/tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/build-tree/armel-libc/misc -I/tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/build-tree/armel-libc -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../ports/sysdeps/unix/sysv/linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../ports -I../nptl -I.. -I../libio -I. -nostdinc -isystem /tmp/buildd/armel-cross-toolchain-base-1.76/debian/tmp/usr/bin/../lib/gcc/arm-linux-gnueabi/4.6.1/include -isystem /tmp/buildd/armel-cross-toolchain-base-1.76/debian/tmp/usr/bin/../lib/gcc/arm-linux-gnueabi/4.6.1/include-fixed -isystem /tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/debian/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/build-tree/armel-libc/misc/syslog.o -MD -MP -MF /tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/build-tree/armel-libc/misc/syslog.o.dt -MT /tmp/buildd/armel-cross-toolchain-base-1.76/eglibc-2.13/build-tree/armel-libc/misc/syslog.o
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:144:9: warning: variable 'prioff' set but not used [-Wunused-but-set-variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to 'syslog': function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here

Revision history for this message
Kees Cook (kees) wrote : Re: [Bug 868924] Re: hardening_patches not enabled for cross builds

The cross compiler should produce the same results as the native compiler.
Since hardening is enabled there, it should be enabled in the
cross-compiler too.

This looks like a specific problem with the glibc build. IIRC, fortify was
explicitly disabled for glibc builds in Ubuntu. doko would know more.

Revision history for this message
Matthias Klose (doko) wrote :

the gcc-snapshot packages stays as close as possible to upstream to check for issues in the development version of GCC. therefore the hardening patches are not applied.

Changed in gcc-4.6 (Ubuntu):
status: Confirmed → Won't Fix
Marcin Juszkiewicz (hrw)
Changed in gcc-4.6 (Ubuntu):
status: Won't Fix → Fix Committed
Changed in gcc-4.6-armel-cross (Ubuntu):
status: Confirmed → In Progress
no longer affects: gcc-linaro
Marcin Juszkiewicz (hrw)
Changed in gcc-4.6 (Ubuntu):
status: Fix Committed → Fix Released
Changed in gcc-4.6-armel-cross (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.6-armel-cross - 1.56

---------------
gcc-4.6-armel-cross (1.56) precise; urgency=low

  * Enabled hardening patches for cross - closes LP: #868924
  * Bumped gcc-4.6 version to 4.6.2-7 as this one has all my patches merged.
  * Dropped gcc-4.4 build dependency.
  * Added lintian overrides.
  * Added build-{arch,indep} targets.
 -- Marcin Juszkiewicz <email address hidden> Mon, 12 Dec 2011 16:54:17 +0100

Changed in gcc-4.6-armel-cross (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.