Bug 1315481

Summary: snmp response: Too long
Product: Red Hat Enterprise Linux 6 Reporter: Bryan Totty <btotty>
Component: net-snmpAssignee: Josef Ridky <jridky>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: high Docs Contact: Mirek Jahoda <mjahoda>
Priority: urgent    
Version: 6.7CC: dapospis, fkrska, hhorak, jridky, jsafrane, mjahoda, mkolaja, moagrawa, rs, zpytela
Target Milestone: rcKeywords: EasyFix, FastFix, Patch, Reproducer, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
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 09:24:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1269194, 1324306, 1356044, 1363606    

Description Bryan Totty 2016-03-07 21:08:25 UTC
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 21:45:48 UTC
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 09:24:43 UTC
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