Bug 1315481 - snmp response: Too long
snmp response: Too long
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-snmp (Show other bugs)
6.7
Unspecified Linux
urgent Severity high
: rc
: ---
Assigned To: Josef Ridky
Dalibor Pospíšil
Mirek Jahoda
: EasyFix, FastFix, Patch, Reproducer, ZStream
Depends On:
Blocks: 1269194 1324306 1356044 1363606
  Show dependency treegraph
 
Reported: 2016-03-07 16:08 EST by Bryan Totty
Modified: 2017-03-21 05:24 EDT (History)
10 users (show)

See Also:
Fixed In Version: net-snmp-5.5-58.el6
Doc Type: Bug Fix
Doc Text:
Previously, all the SNMPv1 and SNMPv2c responses that followed an SNMPv3 message were checked against the last recorded SNMPv3 "max message size" property. As a consequence, an SNMPv3 request with a small "max message size" could lead to SNMPv1 and SNMPv2c bulk requests timing out. With this update, the session maximum message size is checked only for SNMPv3 requests, and the SNMPv1 and SNMPv2c response is no longer timed out.
Story Points: ---
Clone Of:
: 1324306 1363606 (view as bug list)
Environment:
Last Closed: 2017-03-21 05:24:43 EDT
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)

  None (edit)
Description Bryan Totty 2016-03-07 16:08:25 EST
The following upstream bug appears to affect net-snmp-5.5-54.el6_7.1.

https://sourceforge.net/p/net-snmp/bugs/2482/

"An SNMPv3 request with a small max message size can lead to SNMPv1/2c bulk requests timing out. This is because when sending a response the length of the data is checked against a max message property of the session and if it is too big then a "snmp response: Too large" log message is generated. Now the max message size session property is a SNMPv3 thing. For SNMPv1/2c this is normally set to zero which disables this check. So as long as we talk to the agent using SNMPv1/2c everything is fine.

Now things get broken when a SNMPv3 request arrives (you do not need valid credentials for this!). This request provides a max message size property which is recorded in the session. So all the following SNMPv1/2c responses are checked against the last SNMPv3 max message size property. If the response is large enough (e.g. snmpbulkget -Cr100 ...) it will not be sent out. To recover from this either restart the agent or send a SNMPv3 request with a large max message size property.

The fix would be to enable the test against the session max message size in _sess_async_send() which is in snmplib/snmp_api.c for SNMPv3 only.

I attached a script that triggers this. It requires Net::SNMP perl module installed and is called with the target host as parameter. The read community is assumed to be "public"."
Comment 3 Robert Story 2016-03-07 16:45:48 EST
Upstream fix is in the V5-5-patches branch:

commit a93991eaf53b199b19c582b630da25158300a9d1
Author: Robert Story <rstory@localhost>
Date:   Fri Aug 1 10:07:45 2014 -0400

    fix #2482 snmp response: Too long
Comment 21 errata-xmlrpc 2017-03-21 05:24:43 EDT
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/RHBA-2017-0597.html

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