Red Hat Bugzilla – Bug 157851
Patch (net-snmp-5.1.2-agentx_register_callbacks_entry.patch) causes AgentX inoperability
Last modified: 2007-11-30 17:11:06 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050416 Fedora/1.0.3-1.3.1 Firefox/1.0.3
Description of problem:
The patch "net-snmp-5.1.2-agentx_register_callbacks_entry.patch" of the srpm of net-snmp incorrectly fixes the "double free" problem and causes another more important problem: sub-agents using the agentx protocol can not register with a master agent through either a unix socket or tcp port.
The known bug that this said patch aims to fix occurs when the netsnmp_session is free'd by the "snmp_free_session()" call in "net-src-root/snmplib/snmp_api.c" on line 1867 and by "net-src-root/snmplib/callback.c" on line 356. This bug surfaces when the sub-agent shuts down. There is no patch for the problem at the moment.
The new bug is a result of the said patch which creates a copy of the netsnmp_session in "net-src-root/agent/mibgroup/agentx/subagent.c" and sends the copy to be registered through the callback functions, though the subagent uses the original session to send/receive messages to/from the master agent. As a result any mib including the example mibs distributed in the release, do not work as sub-agents.
Note: This has been tried with both the default unix socket (/var/agentx/master) and tcp sockets with the same behavior. Because of the error when the master agent tried to delete the session, it has an error and does not delete the socket when the master shuts down.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile the srpm net-snmp-5.2.1-10.FC3
3. Run the master agent ( /usr/sbin/snmpd -f -Lo -d )
4. Compile a sub-agent, using the example sub-agent server with an example mib.
5. The error message from the agent will occur twice: "AgentX master agent failed to respond to ping"
Actual Results: "AgentX master agent failed to respond to ping"
Expected Results: There should be no error message, and the mib should be able to be queried by an snmp get/walk/table command as appropiate.
The sub-agent feature of net-snmp is a critical function for embedding snmp mib capabilities into applications.
Created attachment 114710 [details]
Double Free Callback Patch
Rober Story (of www.net-snmp.org) created a patch for this bug. I've attached
it here. It should be in the main branch of net-snmp, though i hope this in
time to make the FC4 release.
I've just applied a slightly different patch for this issue, it lies in rawhide
- net-snmp-5.2.1-12 but I will compare it to this proposed patch.
Can you provide a link to net-snmp-5.2.1-12 ? It is not on the
download.fedora.redhat.com site. Thanks