Bug 458937

Summary: net-smp fails to parse if_inet6 when the iface index is greater than 255
Product: Red Hat Enterprise Linux 5 Reporter: Olivier Fourdan <ofourdan>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: kem, mkoci, rvokal, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 22:07:28 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:
Attachments:
Description Flags
Patch to increase the lengths of the index in sscanf none

Description Olivier Fourdan 2008-08-13 11:07:47 UTC
Created attachment 314189 [details]
Patch to increase the lengths of the index in sscanf

Description of problem:

With a large number of interfaces (like in a Xen environments with multiple xen bridges), the index of the interfaces can be greater than 255. In such a case, net-snmp will fails to parse /proc/net/if_inet6 if one of the index is greater than 0xFF and will generate errors.

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

net-snmp-5.3.1-24.el5_2.1

How reproducible:

100% reproducible

Steps to Reproduce:

1.Set-up an system with a lot of network interfaces
2.Check if one of the interfaces in proc/net/if_inet6 has an index greater than 0xFF
3.Install and configure net-snmp
  
Actual results:

snmpd[13835]: ioctl 35123 returned -1 
last message repeated <many> times
...

Expected results:

No error message

Additional info:

The parsing is done in _load_v6() (in agent/mibgroup/ip-mib/data_access/ipaddress_linux.c) with:

        /*
         * fe800000000000000200e8fffe5b5c93 05 40 20 80 eth0
         *             A                    D  P  S  F  I
         * A: address
         * D: device number
         * P: prefix len
         * S: scope (see include/net/ipv6.h, net/ipv6/addrconf.c)
         * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
         * I: interface
         */
        rc = sscanf(line, "%39s %02x %02x %02x %02x %8s\n",
                    addr, &if_index, &pfx_len, &scope, &flags, if_name);

So if the index is greater than 0xFF, scanf %02x will not read the entire index and break the pasing of the remaining items.

Comment 3 RHEL Program Management 2008-08-13 11:41:47 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 4 Martin Kočí 2008-08-13 12:23:18 UTC
QA acked for 5.3.

Comment 8 errata-xmlrpc 2009-01-20 22:07:28 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 therefore 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/RHBA-2009-0230.html