Page MenuHomeFreeBSD

pipe: Avoid calling selrecord() on a closing pipe
ClosedPublic

Authored by markj on Apr 27 2021, 9:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 27 2024, 7:58 PM
Unknown Object (File)
Nov 25 2024, 7:53 PM
Unknown Object (File)
Nov 24 2024, 4:21 PM
Unknown Object (File)
Oct 23 2024, 9:21 AM
Unknown Object (File)
Oct 13 2024, 10:56 PM
Unknown Object (File)
Oct 11 2024, 11:57 AM
Unknown Object (File)
Oct 4 2024, 4:21 AM
Unknown Object (File)
Oct 4 2024, 4:15 AM
Subscribers

Details

Summary

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.

Reported by: syzkaller+KASAN

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable