Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 870332 Details for
Bug 1038007
CVE-2012-6151 net-snmp: snmpd crashes/hangs when AgentX subagent times-out
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
backported patch
net-snmp-5.3.2.2-agentx-closed-session.patch (text/plain), 4.08 KB, created by
Jan Safranek
on 2014-03-04 11:23:54 UTC
(
hide
)
Description:
backported patch
Filename:
MIME Type:
Creator:
Jan Safranek
Created:
2014-03-04 11:23:54 UTC
Size:
4.08 KB
patch
obsolete
>748390 - A subagent may crash when handling response for requests that were sent using an older disconnected main session > >Upstream git commits 13952f6bee9f408867ab6d2fdfdde4f284074957 and 70ea9bb61012a75bb6a62a8c95c861c4d7a6d03f > >Index: agent/mibgroup/agentx/subagent.c >=================================================================== >--- a/agent/mibgroup/agentx/subagent.c (revision 19807) >+++ b/agent/mibgroup/agentx/subagent.c (revision 19808) >@@ -103,6 +103,18 @@ > return 0; > } > >+static void >+subagent_init_callback_session(void) >+{ >+ if (agentx_callback_sess == NULL) { >+ agentx_callback_sess = netsnmp_callback_open(callback_master_num, >+ handle_subagent_response, >+ NULL, NULL); >+ DEBUGMSGTL(("agentx/subagent", "subagent_init sess %08x\n", >+ agentx_callback_sess)); >+ } >+} >+ > /** > * init subagent callback (local) session and connect to master agent > * >@@ -131,13 +143,7 @@ > /* > * open (local) callback session > */ >- if (agentx_callback_sess == NULL) { >- agentx_callback_sess = netsnmp_callback_open(callback_master_num, >- handle_subagent_response, >- NULL, NULL); >- DEBUGMSGTL(("agentx/subagent", "subagent_init sess %08x\n", >- agentx_callback_sess)); >- } >+ subagent_init_callback_session(); > if (NULL == agentx_callback_sess) > return -1; > >@@ -473,6 +479,12 @@ > int rc = 0; > > if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || magic == NULL) { >+ if (op == NETSNMP_CALLBACK_OP_TIMED_OUT && magic != NULL) { >+ if (smagic->ovars != NULL) { >+ snmp_free_varbind(smagic->ovars); >+ } >+ free(smagic); >+ } > return 1; > } > >@@ -987,6 +999,21 @@ > if (main_session != NULL) { > remove_trap_session(ss); > snmp_close(main_session); >+ /* >+ * We need to remove the callbacks attached to the callback >+ * session because they have a magic callback data structure >+ * which includes a pointer to the main session >+ * (which is no longer valid). >+ * >+ * Given that the main session is not responsive anyway. >+ * it shoudn't matter if we lose some outstanding requests. >+ */ >+ if (agentx_callback_sess != NULL ) { >+ snmp_close(agentx_callback_sess); >+ agentx_callback_sess = NULL; >+ >+ subagent_init_callback_session(); >+ } > main_session = NULL; > agentx_reopen_session(0, NULL); > } >--- a/agent/mibgroup/agentx/subagent.c 2011-10-24 15:58:37.669670302 +0530 >+++ b/agent/mibgroup/agentx/subagent.c.fix 2011-10-24 15:58:20.809669918 +0530 >@@ -476,6 +476,26 @@ handle_agentx_packet(int operation, nets > return 1; > } > >+static int >+_invalid_op_and_magic(int op, ns_subagent_magic *smagic) >+{ >+ int invalid = 0; >+ >+ if (smagic && (snmp_sess_pointer(smagic->session) == NULL || >+ op == NETSNMP_CALLBACK_OP_TIMED_OUT)) { >+ if (smagic->ovars != NULL) { >+ snmp_free_varbind(smagic->ovars); >+ } >+ free(smagic); >+ invalid = 1; >+ } >+ >+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || smagic == NULL) >+ invalid = 1; >+ >+ return invalid; >+} >+ > int > handle_subagent_response(int op, netsnmp_session * session, int reqid, > netsnmp_pdu *pdu, void *magic) >@@ -484,13 +504,7 @@ handle_subagent_response(int op, netsnmp > netsnmp_variable_list *u = NULL, *v = NULL; > int rc = 0; > >- if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || magic == NULL) { >- if (op == NETSNMP_CALLBACK_OP_TIMED_OUT && magic != NULL) { >- if (smagic->ovars != NULL) { >- snmp_free_varbind(smagic->ovars); >- } >- free(smagic); >- } >+ if (_invalid_op_and_magic(op, magic)) { > return 1; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1038007
:
870332
|
870333