]> arthur.barton.de Git - netatalk.git/commit
Hangs in Netatalk which causes it to stop responding to connections
authorRalph Boehme <rb@sernet.de>
Sat, 5 Jul 2014 06:14:41 +0000 (08:14 +0200)
committerRalph Boehme <rb@sernet.de>
Thu, 10 Jul 2014 08:31:09 +0000 (10:31 +0200)
commite9391ff790167e35ff92adc20d4779f1d9d651aa
treeaef36f9439cf44e3c354db4de82b717d28d6ff66
parent7c57e3c4fa2b9370fa0ae953e4504741695cecac
Hangs in Netatalk which causes it to stop responding to connections

Hangs in Netatalk which causes it to stop responding to
connections. The master afpd process gets stuck in a poll loop, being
repeatedly notified that there are connections on its socket, but
never actually doesn anything with them.

Analysis with gdb revealed that the dat astructure dealing with the
main AFP socket and the IPC client sockets was smashed. This could
happen because the function fdset_add_fd() doesn't do bound checking
itself but relied on other parts of the code that enforce a connection
limit. Unfortunately, for low-level AFP connections that don't result
in a full AFP login these checks come too late resulting in a buffer
overflow.

Add a bound check. While we're at it, rewrite the fdset code to use a
full blown data structure 'struct asev' encapsultating the
implementation details.

Fixes bug #572.

Signed-off-by: Ralph Boehme <rb@sernet.de>
NEWS
etc/afpd/main.c
include/atalk/util.h
libatalk/util/socket.c