Page MenuHomeFreeBSD

filemon: Reject FILEMON_SET_FD commands when the fd is a kqueue
ClosedPublic

Authored by markj on Feb 1 2022, 2:59 PM.
Tags
None
Referenced Files
F103325542: D34128.id102237.diff
Sat, Nov 23, 2:11 PM
F103318528: D34128.id102237.diff
Sat, Nov 23, 11:58 AM
Unknown Object (File)
Sat, Nov 23, 2:59 AM
Unknown Object (File)
Fri, Nov 22, 11:01 PM
Unknown Object (File)
Thu, Nov 21, 11:21 PM
Unknown Object (File)
Wed, Nov 13, 6:55 AM
Unknown Object (File)
Thu, Oct 31, 6:28 AM
Unknown Object (File)
Mon, Oct 28, 4:01 PM

Details

Summary

When FILEMON_SET_FD is used, the filemon handle effectively wraps the
passed file. In particular, the handle may be inherited by a child
process, or transferred over a unix domain socket, so we must verify
that the backing file permits this.

Reported by: syzbot+36e6be9e02735fe66ca8@syzkaller.appspotmail.com

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44225
Build 41113: arc lint + arc unit

Event Timeline

markj requested review of this revision.Feb 1 2022, 2:59 PM

Looks reasonable. filemon.4 needs an update too?

Document EINVAL and EBADF.

Besides that unrelated nit, the manual page language LGTM. Can't speak to consistency with the code change.

share/man/man4/filemon.4
54–55

"binaries using an emulated ABI" maybe? Neither "of" and "foreign" look quite right.

markj marked an inline comment as done.

Unrelated fixups. Change "will" to "may" since filemon does at least
hook compat32 system calls.

debdrup added a subscriber: debdrup.

Manual page changes look good to me, can't comment on the code.

This revision is now accepted and ready to land.Feb 2 2022, 8:01 AM
emaste added inline comments.
share/man/man4/filemon.4
54–55

"emulated" isn't quite right

Possibly "non-native" or "non-FreeBSD" ABIs

54–55

Oops this comment was stuck as a draft