shalture / shalture-contrib-modules

Community-supported modules for Shaltúre
1 stars 1 forks source link

Proxyscan blacklist segfault #1

Open ManiacTwister opened 9 years ago

ManiacTwister commented 9 years ago

Hello,

If the ircd kills a user (because it has some blacklist configured on its own) the proxyscan/dnsbl crashes services because it tries to kill the user (which is already disconnected) again. Here is the corresponding backtrace.

Program terminated with signal 11, Segmentation fault.
#0  bs_notice (from=0xc39660 "OperServ", target=0x0, fmt=<optimized out>) at main.c:127
127     if (*target == '#' && !strcmp(from, chansvs.nick))
(gdb) bt
#0  bs_notice (from=0xc39660 "OperServ", target=0x0, fmt=<optimized out>) at main.c:127
#1  0x0000032a9f851c19 in dnsbl_hit (blptr=0xc66e60, u=0x32ab9c8ef70) at dnsbl.c:504
#2  blacklist_dns_callback (vptr=<optimized out>, reply=<optimized out>) at dnsbl.c:346
#3  0x0000032ab9408c99 in res_read_single_reply (F=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at res.c:854
#4  0x0000032ab9408d13 in res_readreply (cptr=0xbee5c0) at res.c:870
#5  0x0000032ab966050b in mowgli_epoll_eventloop_select (eventloop=0x32ab9ca1f70, delay=<optimized out>) at epoll_pollops.c:188
#6  0x0000032ab9661515 in mowgli_simple_eventloop_timeout_once (eventloop=0x32ab9ca1f70, timeout=0) at null_pollops.c:55
#7  0x0000032ab9660b4c in mowgli_eventloop_run_once (eventloop=0x32ab9ca1f70) at eventloop.c:129
#8  0x0000032ab940a26f in io_loop () at send.c:77
#9  0x0000032ab93f009b in shalture_main (argc=<optimized out>, argv=0x3ff22fefc88) at atheme.c:451
#10 0x0000032ab906bead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x00000000004005f1 in _start ()

Log Message:

[2015-02-23 16:03:46] user_add(): efiii (~bla@tor-exit.kakapo.dk) -> bla.tld
[2015-02-23 16:03:46] DNSBL: k-lining efiii!~bla@tor-exit.kakapo.dk [irssi] who is listed in DNS Blacklist rbl.efnetrbl.org.
[2015-02-23 16:03:46] <- :00AAAAAAJ NOTICE 42XAAAABO :Your IP address 82.211.223.3 is listed in DNS Blacklist rbl.efnetrbl.org
[2015-02-23 16:03:46] <- :00AAAAAAJ ENCAP * KLINE 86400 * tor-exit.kakapo.dk :Banned (DNS Blacklist)
[2015-02-23 16:03:46] -> :42X NOTICE 00AAAAAAJ :Added temporary 1440 min. K-Line [*@tor-exit.kakapo.dk]
[2015-02-23 16:03:46] -> :42XAAAABO QUIT :K-Lined
[2015-02-23 16:03:46] m_quit(): user leaving: efiii
[2015-02-23 16:03:46] user_delete(): removing user: efiii -> bla.tld (K-Lined)
[2015-02-23 16:03:46] DNSBL: k-lining (null)!(null)@(null) [(null)] who is listed in DNS Blacklist 6667.1.0.0.127.ip-port.exitlist.torproject.org.
ManiacTwister commented 9 years ago

Here is a quick fix for this issue. Don't know if there is something better, so i don't make apull request for now.

https://gist.github.com/ManiacTwister/4a8ba388fa84f63b08bb#file-shalture-dnsbl-patch

ilbelkyr commented 9 years ago

Your patch seems to indicate this is an issue in modules/proxyscan/dnsbl, which is part of Shaltúre core; as such, please report this for the shalture/shalture repository, not this one.

I'll take a look later, though.

(hm, looks like there's a dnsbl.c in contrib that's suspiciously similar to proxyscan/dnsbl, except it uses OperServ; probably should get rid of one of the two.)

Xe commented 9 years ago

This problem should never show up though. With how the blacklist stuff in charybdis works it should pass all the checks before the client is bursted to the network.

maxteufel commented 9 years ago

It looks more like services trying to set the kline two times because the user is listed in two DNSBLs (although the case mentioned should be handled too (for bots which are faster than services)).

ManiacTwister commented 9 years ago

@maxteufel You're right.

@ilbelkyr True. I confused the modules. The contrib module doesn't work at all for me (Propably a configuration error on my side). I'll open a new issue at the shalture repo.