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

Bug 340905

Summary: app-editors/dav _FORTIFY_SOURCE indicates presence of overflow
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: major CC: hardened, signals
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 259417    
Attachments: Build log
buffer overflow fix
New ebuild to apply buffer overflow patch

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-14 01:06:52 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.

Thanks,
Your friendly neighborhood tinderboxer
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-14 01:07:14 UTC
Created attachment 250507 [details]
Build log
Comment 2 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 19:27:39 UTC
Created attachment 261032 [details, diff]
buffer overflow fix
Comment 3 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 19:28:13 UTC
Created attachment 261034 [details]
New ebuild to apply buffer overflow patch
Comment 4 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 19:34:15 UTC
Don't know how the original author let this one slip by. When reading the .davrc file he defines a buffer of 80 bytes, then tries to fgets 200 bytes into it. Everything works OK so long as there aren't any lines in the file > 80 bytes long, but it overflows the buffer if there are.

While not the most robust fix, I've just changed the buffer size to 200 so fgets can't overflow it. Unfortunately, this means that the maximum length of a line in .davrc is 200 bytes. But, anything longer will just be truncated to 200 bytes instead of causing a buffer overflow now.
Comment 5 Kevin McCarthy (RETIRED) gentoo-dev 2011-04-05 18:22:20 UTC
Patch added to portage as app-editors/dav-0.8.5-r1.