HomeFreeBSD

filemon: Reject FILEMON_SET_FD commands when the fd is a kqueue

Description

filemon: Reject FILEMON_SET_FD commands when the fd is a kqueue

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
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b84ed4e7f626de5475cf26bae6d7ff15ec9f9675)

Details

Provenance
markjAuthored on Feb 3 2022, 2:41 PM
Parents
rG14c0cde468e1: shsec: Allocate data blocks only for BIO_READ/WRITE requests
Branches
Unknown
Tags
Unknown