Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 337520 - net-misc/selfdhcp _FORTIFY_SOURCE indicates presence of overflow
Summary: net-misc/selfdhcp _FORTIFY_SOURCE indicates presence of overflow
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: Inclusion, PATCH
Depends on:
Blocks: fortify-source
  Show dependency tree
 
Reported: 2010-09-15 17:23 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2012-03-03 15:44 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (selfdhcp-0.2a:20100915-154400.log,19.02 KB, text/plain)
2010-09-15 17:23 UTC, Diego Elio Pettenò (RETIRED)
Details
Patch to fix buffer overflow (selfdhcp-0.2a-buffer-overflow.patch,574 bytes, patch)
2011-01-29 14:08 UTC, Kevin McCarthy (RETIRED)
Details | Diff
ebuild to apply the patch (selfdhcp-0.2a-r1.ebuild,812 bytes, text/plain)
2011-01-29 14:09 UTC, Kevin McCarthy (RETIRED)
Details
Fixed patch to provide enough space for the \0 (selfdhcp-0.2a-buffer-overflow.patch,576 bytes, patch)
2011-01-29 17:00 UTC, Kevin McCarthy (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-09-15 17:23:11 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-15 17:23:25 UTC
Created attachment 247488 [details]
Build log
Comment 2 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 14:08:48 UTC
Created attachment 260990 [details, diff]
Patch to fix buffer overflow
Comment 3 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 14:09:13 UTC
Created attachment 260991 [details]
ebuild to apply the patch
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-01-29 16:52:00 UTC
Hi Kevin, your patch here has still a problem: strncpy() doesn't ensure a final '\0' with the size provided, so it should be sizeof(dest)-1 rather than simply sizeof(dest). It takes away the warning because it won't hit the limit but it won't take care of terminating it properly, so further errors could creep afterwards. The interface you were expecting is strlcpy() which is not available in GLIBC.
Comment 5 Kevin McCarthy (RETIRED) gentoo-dev 2011-01-29 17:00:28 UTC
Created attachment 261017 [details, diff]
Fixed patch to provide enough space for the \0

Nice catch... I should've known better, but it's been a while since I've done any heavy C development. Anyway, I've uploaded a corrected patch.
Comment 6 Pacho Ramos gentoo-dev 2012-03-03 15:44:43 UTC
+*selfdhcp-0.2a-r1 (03 Mar 2012)
+
+  03 Mar 2012; Pacho Ramos <pacho@gentoo.org>
+  +files/selfdhcp-0.2a-buffer-overflow.patch, +selfdhcp-0.2a-r1.ebuild,
+  -selfdhcp-0.2a.ebuild:
+  Fix overflow, bug #337520 by flameeyes and fix by Kevin McCarthy.
+