Bug 640848 - snmpd always returns an incorrect sysObjectID of ".1.3" or ".0.1"
Summary: snmpd always returns an incorrect sysObjectID of ".1.3" or ".0.1"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-06 21:44 UTC by Jeff Gehlbach
Modified: 2010-10-28 06:16 UTC (History)
1 user (show)

Fixed In Version: net-snmp-5.5-21.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 641113 (view as bug list)
Environment:
Last Closed: 2010-10-22 18:12:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch to fix sysObjectID truncation bug (707 bytes, patch)
2010-10-06 21:46 UTC, Jeff Gehlbach
no flags Details | Diff
Updated proposed patch to fix sysObjectID truncation bug (1.91 KB, patch)
2010-10-07 23:10 UTC, Jeff Gehlbach
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 641113 0 low CLOSED snmpd always returns an incorrect sysObjectID of ".1.3" or ".0.1" 2021-02-22 00:41:40 UTC

Internal Links: 641113

Description Jeff Gehlbach 2010-10-06 21:44:00 UTC
Description of problem:
The "sysObjectID" scalar MIB object (.1.3.6.1.2.1.1.2.0) conveys what kind of device one is talking to via SNMP.  The correct value for a Net-SNMP agent on GNU/Linux is ".1.3.6.1.4.1.8072.3.2.10", but a bug in the Net-SNMP 5.5 code causes this value always to be truncated to ".1.3".  The result is that SNMP management applications (e.g. OpenNMS) are unable to determine from the sysObjectID that they're in fact talking to a Net-SNMP agent at all, let alone one running on Linux.

Version-Release number of selected component (if applicable):
5.5-20 (and all previous releases of 5.5)

How reproducible:
Always

Steps to Reproduce:
1. Install package "net-snmp" and start service "snmp"
2. Run "snmpget -On -v1 -c public localhost sysObjectID.0"
  
Actual results:
[jeffg@rawhide ~]$ snmpget -On -v1 -c public localhost sysObjectID.0
.1.3.6.1.2.1.1.2.0 = OID: .1.3

Expected results:
[jeffg@mephesto ~]$ snmpget -On -v1 -c public localhost sysObjectID.0
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.8072.3.2.10


Additional info:
This bug is fixed in upstream Subversion trunk and upstream version 5.6 release candidates.  It's a one-line fix, which I'll attach as soon as I know the ID of this bug.

Comment 1 Jeff Gehlbach 2010-10-06 21:46:16 UTC
Created attachment 451997 [details]
Proposed patch to fix sysObjectID truncation bug

This patch should apply cleanly to all releases up to and including 20 of version 5.5 of this package.

Comment 2 Jeff Gehlbach 2010-10-06 21:49:51 UTC
This problem affects Fedora 13, Fedora 14 beta, rawhide, and RHEL 6 beta.

I'm happy to provide more information as needed; this is my first bug report in this tracker, so please let me know if I've broken any conventions.

Comment 3 Jeff Gehlbach 2010-10-06 22:11:13 UTC
A bit more information as suggested by fenris02 in #bugzappers:

I'm actually running FC13; my assertion above that the problem affects other releases is based on downloading the net-snmp SRPM associated with each of those releases and inspecting the source and patches contained within.

[root@ip6test ~]# rpm -q net-snmp
net-snmp-5.5-16.fc13.i686

Comment 4 Jeff Gehlbach 2010-10-07 20:23:31 UTC
The initial report states that the sysObjectID always comes out as ".1.3"; this is true on 32-bit i386 installs of F13.  On an x86_64 install, the sysObjectID comes out instead as ".0.1":

[root@f13-64 ~]# rpm -q net-snmp
net-snmp-5.5-16.fc13.x86_64

[root@f13-64 ~]# snmpget -On -v1 -c public localhost sysObjectID.0
.1.3.6.1.2.1.1.2.0 = OID: .0.1

Comment 5 Jeff Gehlbach 2010-10-07 23:06:21 UTC
The attached patch isn't quite sufficient (in fact it doesn't apply cleanly) so I'm doing more research on the upstream revisions that do actually comprise a fix, starting with the list of revisions since the 5.5 release that affect agent/mibgroups/mibII/system_mib.c (which was at r17596 at the time of 5.5 release) and ending at the HEAD of current upstream Subversion trunk (r19399):

r17825  [NO-OP]
Commit message:
"CHANGES: snmpd: BUG: 2900078: Add support for OID variables with size in elements instead of bytes, correct sysObjectID to use this."
Notes on Fedora bug report:
The sole non-whitespace change to system_mib.c in this commit is backed out later in r19382.  Changes in this commit external to system_mib.c are therefore orthogonal to this bug report.  In short, this revision is a no-op for the purposes of the problem at hand.

r18016  [IGNORE]
(Long commit message describing MinGW build fixes)
Notes on Fedora bug report:
The MinGW compilation fixes in this revision are immaterial for purposes of Fedora / RHEL bug reporting, so this revision is a no-op.

r19322  [KEEP]
Commit message:
"CHANGES: snmpd: PATCH: 3044512: from philwebster: fix sysobjectid directive."
Notes on Fedora bug report:
This rev affects only system_mib.c.  One of its changes is subsequently changed again in r19371, but the balance should be retained.

r19371  [KEEP]
Commit message:
"Fixed a compiler warning that was introduced in r19322 (patch 3044512).
The third argument passed to read_objid() was an int instead of size_t.
This could have caused memory corruption on 64-bit systems."
Notes on Fedora bug report:
This rev affects only system_mib.c and is a straightforward type fix as described in commit message.

r19382  [NO-OP]
Commit message:
"Patch from Fulko Hew to fix patch 2900078 which broke sysObjectID lengths"
Notes on Fedora bug report:
This rev affects only system_mib.c and backs out the sole non-whitespace change to that file in r17825, rendering this rev a no-op for our purposes.

Attaching a new patch that represents the balance of all the upstream changes discussed above, and which I've verified applies cleanly, compiles, and corrects the problem described in this bug.

Comment 6 Jeff Gehlbach 2010-10-07 23:10:21 UTC
Created attachment 452222 [details]
Updated proposed patch to fix sysObjectID truncation bug

See Comment 5 for my methodology for arriving at this patch.  Verified that adding this patch to release 12 of this package's spec file and rebuilding does fix the problem.

Comment 7 Jan Safranek 2010-10-11 09:56:37 UTC
Thanks for detailed bug report and patch, I have reproduced the bug locally.

Comment 8 Fedora Update System 2010-10-11 10:48:50 UTC
net-snmp-5.5-17.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/net-snmp-5.5-17.fc13

Comment 9 Fedora Update System 2010-10-11 10:48:56 UTC
net-snmp-5.5-21.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/net-snmp-5.5-21.fc14

Comment 10 Jeff Gehlbach 2010-10-11 18:37:20 UTC
Thank you, Jan!

I just realized that apart from an inter-bug link, there's no mention in this report of Bug 641113 which describes exactly the same issue in RHEL 6, so here's a mention :)

-jeff

Comment 11 Fedora Update System 2010-10-11 19:23:15 UTC
net-snmp-5.5-17.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update net-snmp'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/net-snmp-5.5-17.fc13

Comment 12 Fedora Update System 2010-10-22 18:12:46 UTC
net-snmp-5.5-17.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2010-10-28 06:16:12 UTC
net-snmp-5.5-21.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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