Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 479345

Summary: fuser from psmisc does not parse /proc/net/udp when -n udp is specified
Product: Red Hat Enterprise Linux 5 Reporter: Michael Kearey <mkearey>
Component: psmiscAssignee: Jaromír Cápík <jcapik>
Status: CLOSED ERRATA QA Contact: Branislav Náter <bnater>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.2CC: bnater, cdahlin, ovasik, plyons, rvokal, tao, wmealing
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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-08 03:30:25 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:
Bug Depends On:    
Bug Blocks: 596055, 669309    
Attachments:
Description Flags
patch that corrects error in fuser.c none

Description Michael Kearey 2009-01-09 00:14:02 UTC
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-09 00:17:23 UTC
Created attachment 328511 [details]
patch that corrects error in fuser.c

Comment 2 RHEL Program Management 2009-03-26 17:08:28 UTC
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 Program Management 2010-08-09 18:26:38 UTC
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 16:50:27 UTC
*** Bug 654416 has been marked as a duplicate of this bug. ***

Comment 17 Jan Görig 2011-01-13 10:31:51 UTC
    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 11:42:19 UTC
    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-08 03:30:25 UTC
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