Summary: | net-misc/selfdhcp _FORTIFY_SOURCE indicates presence of overflow | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Component: | Current packages | Assignee: | 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 | Keywords: | Inclusion, PATCH |
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 patch Fixed patch to provide enough space for the \0 |
Description
Diego Elio Pettenò (RETIRED)
![]() Created attachment 247488 [details]
Build log
Created attachment 260990 [details, diff]
Patch to fix buffer overflow
Created attachment 260991 [details]
ebuild to apply the patch
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. 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.
+*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. + |