]> git.ipfire.org Git - thirdparty/hostap.git/commit
eloop: Fix fd_table allocation for epoll and kqueue
authorJouni Malinen <j@w1.fi>
Wed, 2 Jan 2019 09:57:00 +0000 (11:57 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jan 2019 09:57:00 +0000 (11:57 +0200)
commit7153bd46745cd8695ebfd74c5111d85a424ace4a
tree4d9adfe084f423c343ae55e473bf84acf1e3b39f
parent89a7cdd690b48a0c56380cf4609442ed13527f44
eloop: Fix fd_table allocation for epoll and kqueue

The previous implementation did not work if the first registered socket
had fd > 16 or if the fd was more than double the largest value used in
previous registrations. Those cases could result in too small a memory
allocation being used and writes/reads beyond the end of that buffer.

This fix is applicable to CONFIG_ELOOP_EPOLL=y and CONFIG_ELOOP_KQUEUE=y
builds.

Fixes: f0356ec85c46 ("eloop: Add epoll option for better performance")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/eloop.c