CVSROOT: /cvs Module name: src Changes by: v...@cvs.openbsd.org 2020/01/02 22:37:00
Modified files: share/man/man9 : file.9 sys/kern : kern_descrip.c kern_event.c sys/sys : filedesc.h Log message: Fix a file descriptor close race in kqueue_register() After inserting a knote, check that the associated file descriptor still references the same file. Remove the knote if the descriptor has changed because otherwise the kqueue becomes inconsistent with the file descriptor table. There is an analogous race in fcntl(F_SETLK). It is already handled, but the code can be simplified by using the same check as in kqueue_register(). Fix inspired by DragonFly BSD OK mpi@, anton@