Bug 157851 - Patch (net-snmp-5.1.2-agentx_register_callbacks_entry.patch) causes AgentX inoperability
Patch (net-snmp-5.1.2-agentx_register_callbacks_entry.patch) causes AgentX in...
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Depends On:
  Show dependency treegraph
Reported: 2005-05-16 10:17 EDT by W Raul S
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-24 02:53:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Double Free Callback Patch (3.75 KB, patch)
2005-05-23 09:04 EDT, W Raul S
no flags Details | Diff

  None (edit)
Description W Raul S 2005-05-16 10:17:29 EDT
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):

How reproducible:

Steps to Reproduce:
1. Compile the srpm net-snmp-5.2.1-10.FC3
2. Install 
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.

Additional info:

The sub-agent feature of net-snmp is a critical function for embedding snmp mib capabilities into applications.
Comment 1 W Raul S 2005-05-23 09:04:47 EDT
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.

Comment 2 Radek Vokal 2005-05-24 02:53:18 EDT
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. 
Comment 3 W Raul S 2005-05-24 19:15:27 EDT
Can you provide a link to net-snmp-5.2.1-12 ? It is not on the
download.fedora.redhat.com site. Thanks

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