Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 77844 - netstat uses signed int for socket inodes - should be unsigned
Summary: netstat uses signed int for socket inodes - should be unsigned
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: net-tools
Version: 7.3
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-14 11:32 UTC by Robert Walker
Modified: 2007-04-18 16:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-04 14:02:50 UTC


Attachments (Terms of Use)
Treat inodes as unsigned (deleted)
2002-11-14 11:33 UTC, Robert Walker
no flags Details | Diff

Description Robert Walker 2002-11-14 11:32:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3; Linux)

Description of problem:
netstat uses signed int for socket inodes - should be unsigned.
When enough sockets have been used, the inode number exceeds 2^31 and netstat treats this as negative
This causes a crash when processing /proc/net/unix and prevents sockets being matched to processes with the -p option

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


How reproducible:
Always

Steps to Reproduce:
1. Use enough sockets (you don't have to keep them open) so that new sockets are allocated inodes > 2^31 (this may take some time - months in our case when running large nightly tests)
2. Run netstat -a -p

	

Actual Results:  processes cannot be matched to sockets (-p)
segfault when processing UNIX sockets

Expected Results:  processes should be matched to sockets (-p)
UNIX sockets are printed OK

Additional info:

I have produced a patch that makes netstat treat socket inodes as unsigned ints.

Also sent to net-tools maintainer (philb@gnu.org and bernd.eckenfels@inka.de

Comment 1 Robert Walker 2002-11-14 11:33:39 UTC
Created attachment 85005 [details]
Treat inodes as unsigned

Comment 2 Neil Sedley 2003-08-01 08:40:11 UTC
Also seen on 7.1

According to http://www.ussg.iu.edu/hypermail/linux/kernel/0202.2/0834.html 
netstat > 1.60 is fixed.

Comment 3 Radek Vokal 2004-08-16 09:12:24 UTC
Can anyone help me how to reproduce this bug?


Note You need to log in before you can comment on or make changes to this bug.