Bug 1038007 (CVE-2012-6151)

Summary: CVE-2012-6151 net-snmp: snmpd crashes/hangs when AgentX subagent times-out
Product: [Other] Security Response Reporter: Ratul Gupta <ratulg>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jkurik, jsafrane, pfrields, thozza
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-26 14:57:54 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:
Bug Depends On: 969061, 1038011, 1039518, 1073224, 1073225, 1695555    
Bug Blocks: 1001926, 1070397    
Attachments:
Description Flags
backported patch
none
backported patch none

Description Ratul Gupta 2013-12-04 09:19:30 UTC
net-snmp was found to be crashing/hanging due to the heavy load on the subagent AgentX.

Here, snmpd is the master agent, AgentX is the subagent registering to handle a MIB and processing GETNEXT requests. When the subagent is under heavy load, requests start to pile up in the queue, replies from the subagent arrive too late (per log messages) and eventually the subagent is timed out. When the timeout occurs there is a high probability of either a crash (Segfault) or a hang (100% CPU utilisation, tight loop in the snmpd code) dependent on the version of the snmpd under test. This also happens when the subagent dies unexpectedly with outstanding transactions unserviced.

References:
http://seclists.org/oss-sec/2013/q4/398
http://sourceforge.net/p/net-snmp/bugs/2411/

Patch:
http://sourceforge.net/p/net-snmp/patches/1237/?page=0

Comment 1 Ratul Gupta 2013-12-04 09:21:22 UTC
Created net-snmp tracking bugs for this issue:

Affects: fedora-all [bug 1038011]

Comment 3 Fedora Update System 2014-01-07 09:35:33 UTC
net-snmp-5.7.2-13.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2014-01-07 09:40:08 UTC
net-snmp-5.7.2-7.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2014-01-07 09:47:41 UTC
net-snmp-5.7.2-16.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Vincent Danen 2014-01-15 22:41:35 UTC
This issue was corrected in Red Hat Enterprise Linux 6 via RHBA-2013:1150

  http://rhn.redhat.com/errata/RHBA-2013-1150.html

before it was considered a security flaw.

The upstream patch is here:

http://sourceforge.net/p/net-snmp/code/ci/793d596838ff7cb48a73b675d62897c56c9e62df/

Comment 11 Jan Safranek 2014-03-04 11:23:54 UTC
Created attachment 870332 [details]
backported patch

And I've just checked that this patch fixes the bug.

Comment 12 Jan Safranek 2014-03-04 11:26:00 UTC
Created attachment 870333 [details]
backported patch

I accidentally attached wrong patch, this is the right one.

Comment 14 errata-xmlrpc 2014-03-24 17:55:03 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2014:0322 https://rhn.redhat.com/errata/RHSA-2014-0322.html