OpenBSD cvs log

created 2020-01-20T20:45:49Z
begin 2020-01-03T02:16:38Z
end 2020-01-03T05:37:00Z
path src/sys
commits 1

date 2020-01-03T05:37:00Z
author visa
files src/sys/kern/kern_descrip.c log diff annotate
src/sys/kern/kern_event.c log diff annotate
src/sys/sys/filedesc.h log diff annotate
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@