Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 337059

Summary: dev-embedded/tigcc _FORTIFY_SOURCE indicates presence of overflow
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: Current packagesAssignee: Embedded Team (OBSOLETE) <dev-embedded+disabled>
Severity: major CC: hardened, jimtahu
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on: 412487    
Bug Blocks: 151569, 259417    
Attachments: B

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-13 10:48:24 UTC
You're receiving this bug because the package in Summary has produced _FORTIFY_SOURCE related warnings indicating the presence of a sure overflow in a static buffer.

Even though this is not always an indication of a security problem it might even be. So please check this out ASAP.

By the way, _FORTIFY_SOURCE is disabled when you disable optimisation, so don't try finding out the cause using -O0.

Your friendly neighborhood tinderboxer
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-13 10:49:18 UTC
Created attachment 247111 [details]
Comment 2 Pacho Ramos gentoo-dev 2012-03-19 11:47:30 UTC
*** Bug 364315 has been marked as a duplicate of this bug. ***
Comment 3 Chris Reffett (RETIRED) gentoo-dev Security 2012-04-23 22:22:43 UTC
Created attachment 309881 [details, diff]

The cause of the buffer overflow warnings is that sources/ld-tigcc/formats/tios.h has char Signature[8], when it expects an 8-character input. This is overflowing because there needs to be 9 elements allocated to include room for the null-terminator of the string. I think this patch is sufficient to fix it (I'm not familiar with how to use FORTIFY_SOURCE, but this eliminates the warnings about "warning: call to __builtin___strcpy_chk will always overflow destination buffer". There are also errors about "warning: array subscript is above array bounds" and likewise for below array bounds, I'll look at those next.
Comment 4 SpanKY gentoo-dev 2012-04-30 02:54:07 UTC
new beta8 version doesn't warn for me