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)
Dec 23 2023, 10:23 AM
Unknown Object (File)
Dec 20 2023, 10:52 AM
Unknown Object (File)
Nov 11 2023, 4:40 AM
Unknown Object (File)
Aug 28 2023, 2:44 AM
Unknown Object (File)
Aug 28 2023, 2:44 AM
Unknown Object (File)
Aug 28 2023, 2:42 AM
Unknown Object (File)
Aug 26 2023, 7:00 AM
Unknown Object (File)
Jun 25 2023, 6:35 PM
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38896
Build 35785: arc lint + arc unit