#
685dc743 |
|
16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
|
10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
|
#
6b3a9a0f |
|
11-Jan-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
Convert remaining cap_rights_init users to cap_rights_init_one semantic patch: @@ expression rights, r; @@ - cap_rights_init(&rights, r) + cap_rights_init_one(&rights, r)
|
#
feabaaf9 |
|
24-Aug-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
cache: drop the always curthread argument from reverse lookup routines Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs. Tested by: pho
|
#
cc426dd3 |
|
11-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Remove unused argument to priv_check_cred. Patch mostly generated with cocinnelle: @@ expression E1,E2; @@ - priv_check_cred(E1,E2,0) + priv_check_cred(E1,E2) Sponsored by: The FreeBSD Foundation
|
#
12e69f96 |
|
02-Nov-2018 |
Brooks Davis <brooks@FreeBSD.org> |
Add const to input-only char * arguments. These arguments are mostly paths handled by NAMEI*() macros which already take const char * arguments. This change improves the match between syscalls.master and the public declerations of system calls. Reviewed by: kib (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17812
|
#
bc0d7285 |
|
03-Aug-2018 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Fix some filemon path logging issues. - Properly handle snprintf return value for truncation and avoid overflowing the later write with the bogus length. - Increase the msgbufr size to handle a rename of 2 full files. The larger allocation causes a slight performance hit which will be mitigated in the future. A rewrite with sbufs will likely be done as well. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 2 weeks Approved by: so (gtetlow) Reviewed by: kib Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D16098
|
#
6469bdcd |
|
06-Apr-2018 |
Brooks Davis <brooks@FreeBSD.org> |
Move most of the contents of opt_compat.h to opt_global.h. opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941
|
#
718cf2cc |
|
27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/dev: further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
|
#
6c37a3d4 |
|
05-Jun-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Cleanup COMPAT_FREEBSD32 support. This is a NOP. The COMPAT_IA32 was renamed in r205014 to COMPAT_FREEBSD32 and COMPAT_ARCH32 does not seem to have existed. Also remove some leftovers from the sysent rework in r301404. Include freebsd32_util.h for the freebsd32_sysent prototype. X-MFC-With: r301404 Reported by: kib MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
|
#
f738a972 |
|
04-Jun-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Fix build after r301404. X-MFC-With: r301404 MFC after: 1 week
|
#
66afa415 |
|
04-Jun-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Support all architectures by just using sysent. PowerPC64 has two different ABIs, neither of which is elf64_freebsd_sysvec. Using sysent and freebsd32_sysent achieves the same effect. X-MFC-With: r301130 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
#
b7622235 |
|
27-May-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Don't truncate existing error when writing the log. Suggested by: markj MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
7ae27ff9 |
|
27-May-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Write to the log using the tracer's credentials. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
f14fbe72 |
|
27-May-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
exec: Cease tracing if credentials will change with the new image. This also prevents tracing to a P_INEXEC process since it could race with other processes attaching to it in filemon_event_process_exec() due to the filemon_get_proc() race of incrementing ref and then locking the filemon. With the no-P_INEXEC invariant in place the p_filemon may only be the same or NULL when trying to drop it in filemon_event_process_exec(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6545
|
#
23ae5cd7 |
|
26-May-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon exec: Use imgp->execpath rather than vn_fullpath(9). This will be more accurate as the actual name is provided if ran from an absolute path in do_execve(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
9b511ce9 |
|
22-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Handle copyin failures. Skip the log entry as there is nothing good to write out. Don't fail the syscall though since it already succeeded. There's no reason filemon's tracing failure should fail the already-succeeded syscall. Record the error for later to return from close(2) on the filemon devfs file descriptor. Discussed with: markj, sjg, kib (briefly with kib) Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
eac5c9f2 |
|
22-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Remove unused done argument to copyinstr(9). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
4177d9f7 |
|
22-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Return any log write failure encountered when closing the filemon fd. Discussed with: sjg, markj Reviewed by: sjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
d77f7e8c |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Consolidate common link(2) logic. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
8536d1b7 |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Attempt to use the namecache for openat(2) path resolution. This finishes the work done in D2810. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
4f0d7851 |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Use curthread for vn_fullpath. No functional change. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
4d3cfa1d |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Consolidate open(2) and openat(2) code. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
6d2077c2 |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Stop tracking stat(2). None of lstat(2), fstat(2), fstatat(2) were tracked either. The other filemon implementations also do not track stat(2), nor does bmake utilize it. The act of opening a file for read should be enough to decide that a file is a dependency. There could be rare cases where just having a file would cause a dependency but it is unlikely. MFC after: 2 weeks Also noted by: sjg Sponsored by: EMC / Isilon Storage Division
|
#
e0d84b9e |
|
21-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Track filemon usage via a proc.p_filemon pointer rather than its own lists. - proc.p_filemon is added which is protected by PROC_LOCK. This improves performance and avoids double-fork issues, taking allproc_lock while in syscalls, and walking the process tree in syscalls. A particular proc.p_filemon can only be changed to NULL or another filemon, or the filemon inherited, while the filemon->lock is held. - Filemon are reference counted. On the last reference the log will be closed. - When closing the devfs file handle, the filemon will be detached from all processes and inheritance prevented. - Disallow attaching to a process already being traced since filemon is typically intended to be used on children only. This is allowed for curproc as bmake relies on this behavior for rare cases when combining .MAKE with .META. - Detach any previously tracked process on ioctl(FILEMON_SET_PID). - Handle error from devfs_set_cdevpriv() in filemon_open(). - The global filemon lock and lists are removed. - A free list is no longer kept. Previously this list was forever-expanding and never garbage cleaned. - No longer loses track of double-forks. If the process holding the filemon handle closes it will close the log rather than wait on a daemonized process, but it will log all activity until it closes its handle. The filemon will be removed from the process and not inherited. - A separate process count is kept only as an optimization for forced detachment to avoid taking allproc_lock and walking the entire process tree. - struct filemon access is protected by sx(9) filemon->lock as it was before. - Add more comments and KASSERTS. MFC after: 2 weeks Reviewed by: kib, mjg, markj (all on previous versions) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5520
|
#
8a81693a |
|
07-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Only call bwillwrite() for logging to vnodes, as other fo_write() calls do. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
#
e0dae8f1 |
|
01-Mar-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Remove filemon->lock wrappers. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
#
5b83ad4b |
|
27-Feb-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Remove old compatibility checks. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
|
#
a2109e00 |
|
15-Feb-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Filemon: Fix panic when fork1() is called from kproc_create(). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
d5e53f99 |
|
28-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon: Track the process pointer rather than a pid. The process is not held since the process_exit hook is called after the exithold. There is no need to hold the process since the hook will always see it exiting via the process_exit event. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
f889a61a |
|
28-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon: Use process_exec EVENTHANDLER to capture sys_execve. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
e95c55e5 |
|
27-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Follow-up r294967: Mark flags unused. X-MFC-With: r294967 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
2f600962 |
|
27-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon: Trace fork via process_fork event. This avoids needing ugly hooks and needing both a vfork and fork handler. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
79d69913 |
|
27-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon: Use process_exit EVENTHANDLER to capture process exit. This fixes some cases where a process could exit without being untracked by filemon. Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
2b198fe9 |
|
27-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c. It only prints the header from filemon_ioctl. Keep the name though to stay closer to other implementations. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
64c368a4 |
|
27-Jan-2016 |
Bryan Drewery <bdrewery@FreeBSD.org> |
filemon_ioctl: Lock the associated filemon handle before writing to it. Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
#
8b64fa1e |
|
25-Aug-2015 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Avoid taking proctree_lock and searching parents in wrappers if not needed. This should help the case where filemon is loaded but not in use. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
|
#
9fa45e48 |
|
25-Aug-2015 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Remove unneeded inuse list locking in filemon_comment(). Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
|
#
1ab9f216 |
|
25-Aug-2015 |
Bryan Drewery <bdrewery@FreeBSD.org> |
Move common locking for filemon_inuse and struct filemon* to filemon_pid_check(). This keeps the lock for the filemon_inuse list held only while reading the list. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
|
#
3df2b157 |
|
19-Jun-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
sx_sunlock for sx_slock
|
#
c849fda8 |
|
19-Jun-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
filemon_pid_check needs to hold proctree_lock Reviewed by: kib MFC after: few days
|
#
f859e956 |
|
14-Jun-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Latest clang uses openat(2). If the pathname is absolute or dirfd is AT_FDCWD we can handle it exactly like open(2). Otherwise we output an A record to indicate that the path of an open directory needs to be used (earlier in the trace). Differential Revision: D2810 Reviewed by: jhb MFC after: a bit
|
#
89cac24e |
|
05-Aug-2013 |
Hiroki Sato <hrs@FreeBSD.org> |
- Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified PID is valid for monitoring in FILEMON_SET_PID ioctl. - Set the monitored PID to -1 when the process exits. Suggested by: jilles Tested by: sjg MFC after: 3 days
|
#
f9d4b392 |
|
04-Jun-2013 |
David E. O'Brien <obrien@FreeBSD.org> |
Match the options of the kernel.
|
#
93665dff |
|
26-Oct-2012 |
David E. O'Brien <obrien@FreeBSD.org> |
Iterate rather than use recursion. We can blow out the kernel stack if there is a long chain of fork(2)s.
|
#
097f09bb |
|
02-Jul-2012 |
Marcel Moolenaar <marcel@FreeBSD.org> |
There's no need to make filemon specific to i386 and amd64. All LP64 architectures define elf64_freebsd_sysvec and all ILP32 architectures define elf32_freebsd_sysvec.
|
#
eb9aea5a |
|
04-Jun-2012 |
David E. O'Brien <obrien@FreeBSD.org> |
Add the 'filemon' device. 'filemon' is a kernel module that provides a device interface for processes to record system calls of its children. Submitted by: Juniper Networks.
|