CVSROOT: /cvs Module name: src Changes by: an...@cvs.openbsd.org 2020/06/29 12:23:18
Modified files: sys/kern : sys_pipe.c sys/sys : pipe.h Log message: Bring back revision 1.122 with a fix preventing a use-after-free by serializing calls to pipe_buffer_free(). Repeating the previous commit message: Instead of performing three distinct allocations per created pipe, reduce it to a single one. Not only should this be more performant, it also solves a kqueue related issue found by visa@ who also requested this change: if you attach an EVFILT_WRITE filter to a pipe fd, the knote gets added to the peer's klist. This is a problem for kqueue because if you close the peer's fd, the knote is left in the list whose head is about to be freed. knote_fdclose() is not able to clear the knote because it is not registered with the peer's fd. FreeBSD also takes a similar approach to pipe allocations. once again ok mpi@ visa@