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

Bug 337446

Summary: media-sound/subtract_wave _FORTIFY_SOURCE indicates presence of overflow
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: Current packagesAssignee: Gentoo Sound Team <sound>
Severity: major CC: hardened
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 259417    
Attachments: Build log
Patch to substract_wave-0.3.ebuild to use sed to convert offending strcpy into memcpy

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-15 08:10:03 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-15 08:10:44 UTC
Created attachment 247425 [details]
Build log
Comment 2 Kevin Pyle 2010-09-16 04:07:34 UTC
Created attachment 247543 [details, diff]
Patch to substract_wave-0.3.ebuild to use sed to convert offending strcpy into memcpy

Upstream uses strcpy to fill in structure fields that are not meant to be null terminated.  Fortunately, strcpy is used in only five places in the file.  Four of them need to be changed, and one of them uses a variable string (and is a poor reimplementation of strdup, but that is not relevant here).  This sed expression matches the four offending strcpy that copy constant strings and converts them into a memcpy that uses the sizeof the destination as its copy-count.  At present, all such sizes are equal to 4 (see $S/wave_header.h), and all input strings are four characters.