Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55186 - Running net-misc/gip on hardened-x86 gives stack smashing error
Summary: Running net-misc/gip on hardened-x86 gives stack smashing error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Hardened Gentoo
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-25 13:55 UTC by Rumen Yotov
Modified: 2004-06-26 07:40 UTC (History)
1 user (show)

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


Attachments
Patch to src/lib_ipv4.c to fix this bug (lib_ipv4.c.stack-smashing_patch,935 bytes, patch)
2004-06-26 06:12 UTC, Josh Glover (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rumen Yotov 2004-06-25 13:55:59 UTC
> Saw an app called gip (net-misc/gip) and emerged it.
> Description: a nice GNOME GUI for making IP address based calculations.
> But when tring to run it was stopped by PaX, see:
> ...CUT...
> $gip
> gip: stack smashing attack in function short int ipv4_ip2integer(const
> char*, unsigned int*)()

it's not PaX but ssp (stach smashing protector).

> Maybe it's a bug or something else.
> Should i file a bug on it.

it's a bug and you should file a bug, preferably upstream. the problem
is that the call to regexp_match_grab() will fill in the matches array,
except it's too small because there's no room for the NULL terminator
(the regexp will match the 4 octets of the IP address, so the array
should have 4+1 elements, not 4).
PS:using strace gip freezes my computer hard.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 solar (RETIRED) gentoo-dev 2004-06-25 14:18:02 UTC
Rumen,

Thanks for catching this.
I've never used this software and it has more deps that I'm willing to install.
Could you please attach a patch with the corrected buffer sizes?
Comment 2 solar (RETIRED) gentoo-dev 2004-06-25 15:11:24 UTC
Taking a slightly closer look, this thing was designed rather poolrly and there are other places where this same problem will exist.

Can you try appending this function to the .ebuild and tell us if it solves the problem at hand for you.

src_unpack() {
    unpack ${A}
    sed -i -e s/"*matches\["/"*matches\[1+"/g ${S}/src/lib_ipv4.c
}
Comment 3 Rumen Yotov 2004-06-25 21:40:30 UTC
Hi,
Applyed the patch at comment#2: problem solved.
Thanks.
Rumen
Comment 4 Josh Glover (RETIRED) gentoo-dev 2004-06-26 06:12:14 UTC
Created attachment 34190 [details, diff]
Patch to src/lib_ipv4.c to fix this bug
Comment 5 Josh Glover (RETIRED) gentoo-dev 2004-06-26 06:18:58 UTC
I have applied this fix to the ebuild over on Bug #55055 and committed it to CVS. I have also sent the attached patch (attachment #34190 [details, diff]), which was generated by running solar's sed command, upstream. The upstream author got back to me in a day when I emailed him to tell him that Gip was in Portage, so I expect a speedy response here, as well. :)

Rumen, blagodarya mnogo za burzata reakcia!
Solar, thanks for the fix!

Closing this bug.
Comment 6 Josh Glover (RETIRED) gentoo-dev 2004-06-26 07:40:38 UTC
Upstream has accepted the patch for the next release. Good work, guys! :)