git: select: Don't allow unwanted/leftover fds being returned.
sephe at crater.dragonflybsd.org
Mon Aug 28 06:57:14 PDT 2017
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Mon Aug 28 21:49:00 2017 +0800
select: Don't allow unwanted/leftover fds being returned.
The root cause is that the lwp_kqueue_serial will wrap pretty quickly,
6 seconds on my laptop, if the select(2) is polling, either due to heavy
workload or 0 timeout. The POC test:
Fixing this issue by saving the original fd_sets and do additional
kevent filtering before return the fd to userland.
poll(2) suffers the similar issue and will be fixed in later commit.
Summary of changes:
sys/kern/sys_generic.c | 106 ++++++++++++++++++++++++++++++++-----------------
1 file changed, 69 insertions(+), 37 deletions(-)
DragonFly BSD source repository
More information about the Commits