Closed zorun closed 7 years ago
I still have the exact same backtrace with 64a9e8e6e64385df68da9595cf1ffd7e8e36e981 :/ (except for the different line offsets in nlbwmon source, obviously)
(gdb) bt
#0 0x00007f1d1e7b68a0 in raise () from /usr/lib/libc.so.6
#1 0x00007f1d1e7b7f09 in abort () from /usr/lib/libc.so.6
#2 0x00007f1d1e7f9517 in __libc_message () from /usr/lib/libc.so.6
#3 0x00007f1d1e8896bf in __fortify_fail_abort () from /usr/lib/libc.so.6
#4 0x00007f1d1e889682 in __stack_chk_fail_local () from /usr/lib/libc.so.6
#5 0x000055be18251b37 in ipaddr_parse (msg=<optimized out>, arg=0x7ffd30045840) at /home/zorun/tmp/nlbwmon/neigh.c:197
#6 0x00007f1d1f1745f9 in nl_recvmsgs_report () from /usr/lib/libnl-3.so.200
#7 0x00007f1d1f174a29 in nl_recvmsgs () from /usr/lib/libnl-3.so.200
#8 0x000055be182518af in ipaddr_to_ifindex (family=family@entry=2, addr=addr@entry=0x7ffd30045874) at /home/zorun/tmp/nlbwmon/neigh.c:220
#9 0x000055be18251e77 in update_macaddr (family=2, addr=addr@entry=0x7ffd30045920) at /home/zorun/tmp/nlbwmon/neigh.c:309
#10 0x000055be182525c8 in parse_event (reply=<optimized out>, len=<optimized out>, allow_insert=false, update_mac=update_mac@entry=true)
at /home/zorun/tmp/nlbwmon/nfnetlink.c:211
#11 0x000055be182526a3 in handle_dump (msg=<optimized out>, arg=0x7ffd30045abc) at /home/zorun/tmp/nlbwmon/nfnetlink.c:250
#12 0x00007f1d1f1745f9 in nl_recvmsgs_report () from /usr/lib/libnl-3.so.200
#13 0x00007f1d1f174a29 in nl_recvmsgs () from /usr/lib/libnl-3.so.200
#14 0x000055be182528f7 in nfnetlink_dump (allow_insert=<optimized out>) at /home/zorun/tmp/nlbwmon/nfnetlink.c:388
#15 0x000055be18252c75 in handle_refresh (tm=<optimized out>) at /home/zorun/tmp/nlbwmon/nlbwmon.c:154
#16 0x00007f1d1ed54c30 in uloop_run_timeout () from /usr/lib/libubox.so
#17 0x000055be182530d2 in uloop_run () at /usr/include/libubox/uloop.h:111
#18 server_main (argc=<optimized out>, argv=<optimized out>) at /home/zorun/tmp/nlbwmon/nlbwmon.c:364
#19 0x000055be182532a8 in main (argc=7, argv=0x7ffd30045d68) at /home/zorun/tmp/nlbwmon/nlbwmon.c:377
Same here. The issue is that nlmsg_parse() expects to get an array of [max+1]. The call in neigh_parse() is ok but the other two in ipaddr_parse() and link_parse() are given an array of [max] instead of [max+1]. Changing that fixed the crashes for me.
I tried to use nlbwmon on a "fully-fledged" Linux system, with glibc, libnl, etc (Arch Linux x86_64).
However, it either does nothing at all or crashes almost immediately, for instance:
This is on a laptop:
172.23.184.64/26
is my local network, connected on wlan0. When I pass-s 0.0.0.0/0
nlbwmon does not crash, but it seems to do nothing.Here is a backtrace of the crash:
Full backtrace: