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

Bug 337181

Summary: app-misc/clockywock _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
Patch to fix buffer overflow
ebuild to apply the above patch
Fixed to byte-assign the symbols instead of enlarging the buffer for \0

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-13 23:44:31 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-09-13 23:45:00 UTC
Created attachment 247195 [details]
Build log
Comment 2 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-28 18:56:14 UTC
Created attachment 260943 [details, diff]
Patch to fix buffer overflow
Comment 3 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-28 18:57:57 UTC
Created attachment 260945 [details]
ebuild to apply the above patch
Comment 4 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-28 19:10:04 UTC
Uploaded an ebuild for app-misc/clockywock-0.2.3e with this patch in Bug #353082
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-01-29 16:52:57 UTC
The code there seems funky, I'd suggest looking at the whole code to see why it is doing it that way at all, it might very well be that the mistake is in using snprintf() rather than byte-assigning.
Comment 6 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 17:11:58 UTC
Created attachment 261021 [details, diff]
Fixed to byte-assign the symbols instead of enlarging the buffer for \0

The thought had occurred to me that the original author had intended to assign a single byte there instead of a string, but I didn't want to get too far into modifying his code, so I just enlarged the buffers. As it turns out, that is exactly what he had intended, so I removed the snprintf's and replaced them with byte-assignments in this new patch.
Comment 7 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-31 15:17:52 UTC
I sent the patch for the FORTIFY_SOURCE problem upstream and a new version was created that no longer has the issue. I've uploaded a new e-build for clockywock-0.2.3f in bug 353082 and copied you on it Diego. If it looks OK, this bug should probably be closed.
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2011-02-09 19:57:11 UTC
Fixed by 0.2.3f