Fix: various compat poll/epoll issues
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Jan 2015 21:43:04 +0000 (16:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Jan 2015 21:47:26 +0000 (16:47 -0500)
commit2889fda91cd6916a39d8b09ba7b09b7903e3410c
tree4c7aec4cca4fe4d7992e5387baf32735c1331419
parent774a7dbd1ec4f945b402722d44d2aef35e794b11
Fix: various compat poll/epoll issues

poll:
- fix two nb_fd off by one in "add",
- simplify array size calculation,
- add error checking,
- compress the content of array before resizing it on "del"
  (out-of-bound memory access issue),
- set wait.nb_fd = 0 when no FD are present in array on wait,
- remove need_realloc flag: this can be checked internally by comparing
  current->alloc_size and wait->alloc_size. Minimize the number of
  duplicated state.

epoll:
- add error checking,
- simplify array size calculation (make it similar to poll),
- Set default size when poll_max_size is 0 within
  compat_epoll_set_max_size(), which allow better error checking
  elsewhere in epoll compat code.

Fixes #747

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
src/common/compat/compat-poll.c
src/common/compat/compat-epoll.c
src/common/compat/compat-poll.c
src/common/compat/poll.h
This page took 0.025098 seconds and 4 git commands to generate.