From 4eb20a4ea7cf78f84d015cefa160aff806c35ec7 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 19 Nov 2021 18:08:23 -0500 Subject: Add filemon(4) ioctl definitions for FreeBSD (#2887) * sys/freebsd: add definitions for filemon(4) * pkg/build: load filemon.ko on FreeBSD --- pkg/build/freebsd.go | 1 + sys/freebsd/filemon.txt | 13 +++++++++++++ sys/freebsd/filemon.txt.const | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 sys/freebsd/filemon.txt create mode 100644 sys/freebsd/filemon.txt.const diff --git a/pkg/build/freebsd.go b/pkg/build/freebsd.go index 2d95d2415..f5a3b04da 100644 --- a/pkg/build/freebsd.go +++ b/pkg/build/freebsd.go @@ -89,6 +89,7 @@ cc_dctcp_load="YES" cc_hd_load="YES" cc_htcp_load="YES" cc_vegas_load="YES" +filemon_load="YES" kern.ipc.tls.enable="1" vm.panic_on_oom="1" diff --git a/sys/freebsd/filemon.txt b/sys/freebsd/filemon.txt new file mode 100644 index 000000000..7f405814d --- /dev/null +++ b/sys/freebsd/filemon.txt @@ -0,0 +1,13 @@ +# Copyright 2021 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include +include +include + +resource fd_filemon[fd] + +openat$filemon(fd const[AT_FDCWD], file ptr[in, string["/dev/filemon"]], flags flags[open_flags], mode const[0]) fd_filemon + +ioctl$FILEMON_SET_FD(fd fd_filemon, cmd const[FILEMON_SET_FD], arg ptr[in, fd]) +ioctl$FILEMON_SET_PID(fd fd_filemon, cmd const[FILEMON_SET_PID], arg ptr[in, pid]) diff --git a/sys/freebsd/filemon.txt.const b/sys/freebsd/filemon.txt.const new file mode 100644 index 000000000..f531a8f6d --- /dev/null +++ b/sys/freebsd/filemon.txt.const @@ -0,0 +1,7 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64 +AT_FDCWD = 18446744073709551516 +FILEMON_SET_FD = 3221508865 +FILEMON_SET_PID = 3221508866 +SYS_ioctl = 54 +SYS_openat = 499 -- cgit mrf-deployment