Bug 205353 - smbd allows ports higher than 65536.
Summary: smbd allows ports higher than 65536.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: samba
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Simo Sorce
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 222397 253671 429003
TreeView+ depends on / blocked
 
Reported: 2006-09-06 08:50 UTC by Jose Plans
Modified: 2013-01-16 18:05 UTC (History)
4 users (show)

Fixed In Version: RHEA-2007-0698
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-13 21:38:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch fixing the problem. (1.20 KB, patch)
2006-09-06 08:50 UTC, Jose Plans
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0711 0 normal SHIPPED_LIVE samba bug fix and enhancement update 2008-07-23 16:22:02 UTC
Red Hat Product Errata RHEA-2007:0698 0 normal SHIPPED_LIVE samba bug fix and enhancement update 2007-11-14 22:27:45 UTC

Description Jose Plans 2006-09-06 08:50:23 UTC
Description of problem:

  When an invalid port number that exceeds 0x10000(65536) is specified by the
  smbd and nmbd command, an improper port number is generated.
  
  ** port number definition: unsigned short
  
  ex.) specified number: 65537(0x10001)
   ** generated port number : 1 → 65537(0x10001) - 65536(0x10000)
  
[root@RHEL4U4]# smbd -p 65537

[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
smbd      24449 root   20u  IPv4  66689       TCP *:tcpmux (LISTEN)

[root@RHEL4U4]# nmbd -p 65537
[root@RHEL4U4]# lsof -i
COMMAND     PID USER   FD   TYPE DEVICE SIZE NODE NAME
......................................................................... ......
smbd      24449 root   20u  IPv4  66689       TCP *:tcpmux (LISTEN)
nmbd      24453 root    7u  IPv4  66768       UDP *:tcpmux
nmbd      24453 root    8u  IPv4  66769       UDP *:netbios-dgm
nmbd      24453 root    9u  IPv4  66771       UDP 10.34.211.121:tcpmux
nmbd      24453 root   10u  IPv4  66772       UDP 10.34.211.121:netbios-dgm
[root@RHEL4U4]#
[root@RHEL4U4]# less /etc/services | grep tcpmux
tcpmux          1/tcp                           # TCP port service multiplexer
tcpmux          1/udp                           # TCP port service multiplexer

[root@RHEL4U4]# less /etc/services | grep netbios-dgm
netbios-dgm     138/tcp                         # NETBIOS Datagram Service
netbios-dgm     138/udp


Version-Release number of selected component (if applicable):
All, even upstream.

How reproducible:
Always.

Steps to Reproduce:
1. As shown on the description. smbd -p 65537; lsof -i
  
Actual results:
tcpmux (port 1 is listening)

Expected results:
default smbd/nmbd set.

Additional info:
[Patch proposed]

Comment 1 Jose Plans 2006-09-06 08:50:24 UTC
Created attachment 135637 [details]
Patch fixing the problem.

Comment 2 RHEL Program Management 2007-05-09 09:42:23 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 errata-xmlrpc 2007-11-15 16:14:38 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2007-0698.html


Comment 12 Petr Šplíchal 2008-06-12 10:21:09 UTC
Just to make it clear for possible further testing: The final patch does not set
ports to default values when a bad port number is specified. Instead the
solution is that these bad ports are ignored (no ports are opened by smbd).


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