[haiku-bugs] Re: [Haiku] #6280: Long network interface names cause problems

  • From: "axeld" <trac@xxxxxxxxxxxx>
  • Date: Thu, 22 Jul 2010 12:37:06 -0000

#6280: Long network interface names cause problems
---------------------------------+------------------------------------------
  Reporter:  atis.elsts          |         Owner:  nobody   
      Type:  bug                 |        Status:  closed   
  Priority:  normal              |     Milestone:  R1       
 Component:  Network & Internet  |       Version:  R1/alpha2
Resolution:  fixed               |      Keywords:           
Blocked By:                      |   Has a Patch:  0        
  Platform:  All                 |      Blocking:           
---------------------------------+------------------------------------------
Changes (by axeld):

  * status:  new => closed
  * resolution:  => fixed


Old description:

> There is a potential crash when the length of an interface name is equal
> to IF_NAMESIZE. In this case the C string in the ifr_name field may not
> be null-terminated. This situation should be taken in account everywhere
> when the struct ifreq is used in the kernel and in the userspace.
>
> To repeat: try to configure intarface alias with name
> '/dev/net/etherpci/0:123456789012':
> ifconfig /dev/net/etherpci/0:123456789012 1.2.3.4

New description:

 There is a potential crash when the length of an interface name is equal
 to IF_NAMESIZE. In this case the C string in the ifr_name field may not be
 null-terminated. This situation should be taken in account everywhere when
 the struct ifreq is used in the kernel and in the userspace.

 To repeat: try to configure intarface alias with name
 '/dev/net/etherpci/0:123456789012':
 {{{
 ifconfig /dev/net/etherpci/0:123456789012 1.2.3.4
 }}}

--

Comment:

 Since the kernel would only cut off the extra bytes, I've just fixed the
 userland tools to fail earlier with the "interface name too long" message
 in r37689.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6280#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: