double free crash, with snmp_sess_timeout

SURYA T S <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <CAE53MwWhLfmG5yGoVjbTuPQCHCpBMDV0LMC1-4davGVQNT+kEA@mail.gmail.com>
Hi,

I am using netsnmp 5.8, and facing double free crash on
snmp_synch_response, while trying to send snmp inform packets. Crash
is happening in snmp_sess_timeout, while trying to free varbinds.

gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x0000ffffad811f54 in __GI_abort () at abort.c:79
#2 0x0000ffffad85c274 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0xffffad914a68 "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x0000ffffad86352c in malloc_printerr (str=str@entry=0xffffad9104f0
"double free or corruption (!prev)") at malloc.c:5332
#4 0x0000ffffad8650d0 in _int_free (av=0xffffa8000020,
p=0xffffa8007de0, have_lock=) at malloc.c:4317
#5 0x0000ffffada30834 in snmp_free_varbind (var=) at snmp_api.c:5800
#6 0x0000ffffada34bf8 in snmp_free_pdu (pdu=0xffffa80133f0) at snmp_api.c:5840
#7 snmp_free_pdu (pdu=0xffffa80133f0) at snmp_api.c:5809
#8 0x0000ffffada36a40 in snmp_sess_timeout
(sessp=sessp@entry=0xffffa8006710) at snmp_api.c:7189
#9 0x0000ffffada36b98 in snmp_timeout () at snmp_api.c:7017
#10 0x0000ffffada13a80 in snmp_synch_response_cb (ss=0xffffa8001660,
pdu=pdu@entry=0xffffa80133f0,
response=response@entry=0xffffacc96078, pcb=pcb@entry=0xffffada12f80
<snmp_synch_input>) at snmp_client.c:1085
#11 0x0000ffffada13bc4 in snmp_synch_response (ss=,
pdu=pdu@entry=0xffffa80133f0,
response=response@entry=0xffffacc96078) at snmp_client.c:1126

I have tried patches below patches as mentioned in
https://sourceforge.net/p/net-snmp/patches/1391/?limit=25, but issue
is still seen.

0002-snmplib-snmp_api-Remove-the-request-on-the-session-w.patch
0001-BUG2914-Agent-master-needs-to-treat-resend-as-normal.patch

Do I need to add any more patches to get this issue fixed.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.