K 10 svn:author V 5 markj K 8 svn:date V 27 2021-05-05T15:04:40.590422Z K 7 svn:log V 755 pipe: Avoid calling selrecord() on a closing pipe pipe_poll() may add the calling thread to the selinfo lists of both ends of a pipe. It is ok to do this for the local end, since we know we hold a reference on the file and so the local end is not closed. It is not ok to do this for the remote end, which may already be closed and have called seldrain(). In this scenario, when the polling thread wakes up, it may end up referencing a freed selinfo. Guard the selrecord() call appropriately. Reviewed by: kib Reported by: syzkaller+KASAN Differential Revision: https://reviews.freebsd.org/D30016 (cherry picked from commit d1e9441583fd85c7de5f48197d80c287f1a9494b) Git Hash: 53a9046635f1856e549f28fba20d9ffc068fa81e Git Author: markj@FreeBSD.org END