Bug 479345 - fuser from psmisc does not parse /proc/net/udp when -n udp is specified
fuser from psmisc does not parse /proc/net/udp when -n udp is specified
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: psmisc (Show other bugs)
5.2
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Jaromír Cápík
Branislav Náter
: ZStream
: 654416 (view as bug list)
Depends On:
Blocks: 596055 669309
  Show dependency treegraph
 
Reported: 2009-01-08 19:14 EST by Michael Kearey
Modified: 2013-01-10 21:30 EST (History)
7 users (show)

See Also:
Fixed In Version: psmisc-22.2-9
Doc Type: Bug Fix
Doc Text:
Previously, using the fuser command to list processes that use a UDP port failed to produce the expected results. This was caused by an incorrect use of the /proc/net/tcp socket table instead of /proc/net/udp. With this update, the underlying source code has been adjusted to parse the correct socket table, and fuser no longer fails to list processes for UDP ports.
Story Points: ---
Clone Of:
: 596055 (view as bug list)
Environment:
Last Closed: 2013-01-07 22:30:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch that corrects error in fuser.c (597 bytes, patch)
2009-01-08 19:17 EST, Michael Kearey
no flags Details | Diff

  None (edit)
Description Michael Kearey 2009-01-08 19:14:02 EST
Description of problem:
Small error in fuser.c from psmisc package, when namespace udp is chosen. The fuser program never gets a list of udp connections from /proc/net/udp - it always parses /proc/net/tcp



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

How reproducible:
100%

Steps to Reproduce:
1. Use netstat -unlp to get a list of UDP sockets listening on the host, for example:

# netstat -elnup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       User       Inode      PID/Program name   
udp        0      0 0.0.0.0:161                 0.0.0.0:*                               0          9949       3115/snmpd         
udp        0      0 0.0.0.0:819                 0.0.0.0:*                               0          8954       2763/rpc.statd      
udp        0      0 192.168.122.1:53            0.0.0.0:*                               0          13044      3660/dnsmasq        
udp        0      0 0.0.0.0:822                 0.0.0.0:*                               0          8963       
2763/rpc.statd 


2.Use fuser to get details of the UDP ports:

# fuser -u 161/udp
# fuser -u 819/udp
# fuser -u 53/udp
53/udp:               3660(nobody)
# fuser -u 822/udp

  
Actual results:

# fuser -u 161/udp   reports no details
# fuser -u 819/udp   reports no details
# fuser -u 53/udp   reports no details

Expected results:

fuser should report the correct details for the UDP socket:

# fuser -u 161/udp
161/udp:              3115(root)
# fuser -u 819/udp
819/udp:              2763(rpcuser)
# fuser -u 53/udp
53/udp:               3660(nobody)
# fuser -u 822/udp
822/udp:              2763(rpcuser)


Additional info: Patch that corrects the problem attached.
Comment 1 Michael Kearey 2009-01-08 19:17:23 EST
Created attachment 328511 [details]
patch that corrects error in fuser.c
Comment 2 RHEL Product and Program Management 2009-03-26 13:08:28 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 6 RHEL Product and Program Management 2010-08-09 14:26:38 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 8 Jan Görig 2010-11-22 11:50:27 EST
*** Bug 654416 has been marked as a duplicate of this bug. ***
Comment 17 Jan Görig 2011-01-13 05:31:51 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
- Show processes that uses UDP port
Consequence
- Processes aren't listed due to using TCP table instead of UDP.
Fix
- UDP listing now uses UDP table instead of TCP
Result
- Processes that uses UDP are correctly listed
Comment 18 Jaromir Hradilek 2011-01-14 06:42:19 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,8 +1 @@
-Cause
+Previously, using the fuser command to list processes that use a UDP port failed to produce the expected results. This was caused by an incorrect use of the /proc/net/tcp socket table instead of /proc/net/udp. With this update, the underlying source code has been adjusted to parse the correct socket table, and fuser no longer fails to list processes for UDP ports.-- Show processes that uses UDP port
-Consequence
-- Processes aren't listed due to using TCP table instead of UDP.
-Fix
-- UDP listing now uses UDP table instead of TCP
-Result
-- Processes that uses UDP are correctly listed
Comment 24 errata-xmlrpc 2013-01-07 22:30:25 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0118.html

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