Bug 77844 - netstat uses signed int for socket inodes - should be unsigned
netstat uses signed int for socket inodes - should be unsigned
Product: Red Hat Linux
Classification: Retired
Component: net-tools (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2002-11-14 06:32 EST by Robert Walker
Modified: 2007-04-18 12:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-04 09:02:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Treat inodes as unsigned (6.32 KB, patch)
2002-11-14 06:33 EST, Robert Walker
no flags Details | Diff

  None (edit)
Description Robert Walker 2002-11-14 06:32:12 EST
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:

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 06:33:39 EST
Created attachment 85005 [details]
Treat inodes as unsigned
Comment 2 Neil Sedley 2003-08-01 04:40:11 EDT
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 05:12:24 EDT
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.