Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1090011 - Need to limit names of new interfaces to IFNAMSIZ
Need to limit names of new interfaces to IFNAMSIZ
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: netcf (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Laine Stump
Virtualization Bugs
:
Depends On: 1206680
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-22 07:32 EDT by yanbing du
Modified: 2015-11-19 03:58 EST (History)
5 users (show)

See Also:
Fixed In Version: netcf-0.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-19 03:58:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2248 normal SHIPPED_LIVE Moderate: netcf security, bug fix, and enhancement update 2015-11-19 04:11:05 EST

  None (edit)
Description yanbing du 2014-04-22 07:32:30 EDT
Description of problem:
in /usr/include/net/if.h. 
/* Length of interface name.  */
#define IF_NAMESIZE     16

But libvirt/netcf didn't process the name given by user, which will lead to interface/bridge start fail.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7.x86_64


How reproducible:
100% 

Steps to Reproduce:
1. Create a bridge via virsh command

 # virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
eth0                 active     44:37:e6:4a:42:d1
lo                   active     00:00:00:00:00:00

# virsh iface-bridge lo abcdefghijklmnopq
Created bridge abcdefghijklmnopq with attached device lo
error: Failed to start bridge interface abcdefghijklmnopq
error: internal error: failed to create (start) interface abcdefghijklmnopq: failed to execute external program - Running 'ifup abcdefghijklmnopq' failed with exit code 1: device abcdefghijklmnopq already exists; can't create bridge with the same name

# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
abcdefghijklmnopq    inactive
eth0                 active     44:37:e6:4a:42:d1

# brctl show
bridge name    bridge id        STP enabled    interfaces
abcdefghijklmno        8000.000000000000    no       
virbr0        8000.52540048acc5    yes        virbr0-nic

# virsh iface-unbridge abcdefghijklmnopq
Device lo un-attached from bridge abcdefghijklmnopq
Interface lo started

 virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
eth0                 active     44:37:e6:4a:42:d1
lo                   active     00:00:00:00:00:00

# brctl show
bridge name    bridge id        STP enabled    interfaces
abcdefghijklmno        8000.000000000000    no       
virbr0        8000.52540048acc5    yes        virbr0-nic

Actual result:
By using the lone bridge name, libvirt can define a bridge, but can't start it, as system only take the first 16 characters to create a bridge and which will not deleted/undefined by virsh iface-unbridge command.

Expected results:
Before create the interface/bridge, libvirt need process the name. 

Additional info:
Comment 3 John Ferlan 2015-05-19 13:06:45 EDT
This was not a libvirt issue - it was a netcf issue (changed the component).

In any case, netcf 0.2.4 has the following commit:

commit ccf88a39fb3a0efdff0fefe1903664fec541b747
Author: jmiao <jmiao@redhat.com>
Date:   Mon Apr 21 18:01:12 2014 +0800

    Don't allow defining an interface with length > IFNAMSIZ-1
    
    drv_define() needs to check the length of interface's name to prevent
    the actual name being different (truncated) from the configured name.
    
    Signed-off-by: jmiao <jmiao@redhat.com>

Which resolves the issue.

Moving to MODIFIED as once the depends on bz is resolved for RHEL7.2 this will be resolved.

FWIW: Using the same command on a much more recent upstream environment results in the following:

# virsh iface-bridge lo abcdefghijklmnopq
error: Failed to define new bridge interface abcdefghijklmnopq
error: internal error: could not get interface XML description: internal error - The interface name 'abcdefghijklmnopq' exceeds the maximum allowed length: 15

#
Comment 6 Hu Jianwei 2015-05-27 22:15:40 EDT
Verified as below:

[root@localhost ~]# rpm -q netcf
netcf-0.2.8-1.el7.x86_64
[root@localhost ~]# 
[root@localhost ~]# virsh iface-list --all
 Name                 State      MAC Address
---------------------------------------------------
 eno1                 active     24:be:05:18:81:ce
 enp2s0               inactive   00:1b:21:27:4e:ce
 lo                   active     00:00:00:00:00:00

[root@localhost ~]# virsh iface-bridge lo abcdefghijklmnopq
error: Failed to define new bridge interface abcdefghijklmnopq
error: internal error: could not get interface XML description: internal error - The interface name 'abcdefghijklmnopq' exceeds the maximum allowed length: 15

We can get expected results, changed to Verified.
Comment 8 errata-xmlrpc 2015-11-19 03:58:12 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.

https://rhn.redhat.com/errata/RHSA-2015-2248.html

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