| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34128
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
semantic patch:
@@
expression rights, r;
@@
- cap_rights_init(&rights, r)
+ cap_rights_init_one(&rights, r)
|
| |
|
|
|
|
|
|
|
| |
Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs.
Tested by: pho
Notes:
svn path=/head/; revision=364633
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch mostly generated with cocinnelle:
@@
expression E1,E2;
@@
- priv_check_cred(E1,E2,0)
+ priv_check_cred(E1,E2)
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=341827
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=340080
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
Notes:
svn path=/head/; revision=337272
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add macros to allow preinitialization of cap_rights_t.
- Convert most commonly used code paths to use preinitialized cap_rights_t.
A 3.6% speedup in fstat was measured with this change.
Reported by: mjg
Reviewed by: oshogbo
Approved by: sbruno
MFC after: 1 month
Notes:
svn path=/head/; revision=333425
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=332122
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=326255
|
| |
|
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=304008
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=301460
|
| |
|
|
|
|
|
|
| |
X-MFC-With: r301404
MFC after: 1 week
Notes:
svn path=/head/; revision=301414
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=301404
|
| |
|
|
|
|
|
|
|
| |
Suggested by: markj
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=300893
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=300892
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=300891
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=300890
|
| |
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=300809
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297256
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=297203
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297202
|
| |
|
|
|
|
|
|
|
|
| |
Discussed with: sjg, markj
Reviewed by: sjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297201
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reference.
If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns. This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited. This was only really part of the
daemonized process case which is abnormal.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297200
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297172
|
| |
|
|
|
|
|
|
|
|
| |
This finishes the work done in D2810.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297161
|
| |
|
|
|
|
|
|
|
|
| |
No functional change.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297159
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=297158
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=297157
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
Notes:
svn path=/head/; revision=297156
|
| |
|
|
|
|
|
|
|
| |
MFC after: 1 week
Suggested by: mjg
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296575
|
| |
|
|
|
|
|
|
|
|
| |
This was lost in git rebasing, though it has no functional change.
X-MFC-With: r296472
MFC after: 1 week
Notes:
svn path=/head/; revision=296473
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Code may still be executing from the wrappers at unload time and thus is
not generally safe to unload. Converting the wrappers to use
EVENTHANDLER(9) will allow this to safely drain on active threads in
hooks. More work on EVENTHANDLER(9) is needed first.
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296472
|
| |
|
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296470
|
| |
|
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296286
|
| |
|
|
|
|
|
|
| |
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=296148
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=295649
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=295027
|
| |
|
|
|
|
|
|
|
|
| |
Only ioctl(FILEMON_SET_PID) should be setting the process-to-be-traced.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=295026
|
| |
|
|
|
|
|
|
| |
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=295017
|
| |
|
|
|
|
|
|
|
| |
X-MFC-With: r294967
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=294968
|
| |
|
|
|
|
|
|
|
|
|
| |
This avoids needing ugly hooks and needing both a vfork and fork
handler.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=294967
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=294965
|
| |
|
|
|
|
|
|
|
| |
Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=294957
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=294953
|
| |
|
|
|
|
|
|
|
| |
Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=294952
|