Bug 53708

Summary: netstat seg faults when reading services
Product: [Retired] Red Hat Linux Reporter: Need Real Name <kdawg>
Component: net-toolsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-22 14:45:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-09-16 06:49:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

Description of problem:
Netstat, and probably other programs that read the /etc/services map to 
display service names in output can segfault if for some reason there is 
an entry with a long service name. This is not really a problem, though it 
could be if for some reason netstat (or some other program) was running 
suid. Netstat (atleast the one included with net-tools 1.53) is vulnerable 
to this, and defaults to not use numeric output. It's just an annoyance.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. open /etc/services
2. add/modify an entry for a port your machine is listening on with a (> 
256 chars?)long service name
3. run netstat
	

Actual Results:  segmentation fault

Expected Results:  trimmed output

Additional info:

Comment 1 Phil Knirsch 2002-02-24 10:52:57 UTC
I just verified that this still happens on 7.2. If time permits i'll look into
it, but as netstat is not suid (as you already mentioned) and services normally
aren't that long this is nothing very serious, but a bug nonetheless :-)

Read ya, Phil

Comment 2 Phil Knirsch 2003-05-22 14:45:16 UTC
Actually now that i thought about it some more it's probably not worth fixing as
this hardly ever happens.

Thanks for reporting though.

Read ya, Phil