FreeBSD kernel kern code
vfs_syscalls.c File Reference
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include "opt_ktrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/capsicum.h>
#include <sys/disk.h>
#include <sys/sysent.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/sysproto.h>
#include <sys/namei.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filio.h>
#include <sys/limits.h>
#include <sys/linker.h>
#include <sys/rwlock.h>
#include <sys/sdt.h>
#include <sys/stat.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/dirent.h>
#include <sys/jail.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <machine/stdarg.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/uma.h>
#include <fs/devfs/devfs.h>
Include dependency graph for vfs_syscalls.c:

Go to the source code of this file.

Data Structures

struct  sync_args
 
struct  quotactl_args
 
struct  statfs_args
 
struct  fstatfs_args
 
struct  getfsstat_args
 
struct  fchdir_args
 
struct  chdir_args
 
struct  chroot_args
 
struct  open_args
 
struct  openat_args
 
struct  mknodat_args
 
struct  mkfifo_args
 
struct  mkfifoat_args
 
struct  link_args
 
struct  linkat_args
 
struct  symlink_args
 
struct  symlinkat_args
 
struct  undelete_args
 
struct  unlink_args
 
struct  unlinkat_args
 
struct  funlinkat_args
 
struct  lseek_args
 
struct  access_args
 
struct  faccessat_args
 
struct  eaccess_args
 
struct  fstatat_args
 
struct  pathconf_args
 
struct  lpathconf_args
 
struct  readlink_args
 
struct  readlinkat_args
 
struct  chflags_args
 
struct  chflagsat_args
 
struct  lchflags_args
 
struct  fchflags_args
 
struct  chmod_args
 
struct  fchmodat_args
 
struct  lchmod_args
 
struct  fchmod_args
 
struct  chown_args
 
struct  fchownat_args
 
struct  lchown_args
 
struct  fchown_args
 
struct  utimes_args
 
struct  futimesat_args
 
struct  lutimes_args
 
struct  futimes_args
 
struct  truncate_args
 
struct  fsync_args
 
struct  rename_args
 
struct  renameat_args
 
struct  mkdir_args
 
struct  mkdirat_args
 
struct  rmdir_args
 
struct  umask_args
 
struct  revoke_args
 
struct  lgetfh_args
 
struct  getfh_args
 
struct  getfhat_args
 
struct  fhlink_args
 
struct  fhlinkat_args
 
struct  fhreadlink_args
 
struct  fhopen_args
 
struct  fhstat_args
 
struct  fhstatfs_args
 

Macros

#define UTIMENS_NULL   0x1
 
#define UTIMENS_EXIT   0x2
 

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DEFINE (M_FADVISE, "fadvise", "posix_fadvise(2) information")
 
static int kern_chflagsat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, u_long flags, int atflag)
 
static int setfflags (struct thread *td, struct vnode *, u_long)
 
static int getutimes (const struct timeval *, enum uio_seg, struct timespec *)
 
static int getutimens (const struct timespec *, enum uio_seg, struct timespec *, int *)
 
static int setutimes (struct thread *td, struct vnode *, const struct timespec *, int, int)
 
static int vn_access (struct vnode *vp, int user_flags, struct ucred *cred, struct thread *td)
 
static int kern_fhlinkat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, fhandle_t *fhp)
 
static int kern_readlink_vp (struct vnode *vp, char *buf, enum uio_seg bufseg, size_t count, struct thread *td)
 
static int kern_linkat_vp (struct thread *td, struct vnode *vp, int fd, const char *path, enum uio_seg segflag)
 
static uint64_t at2cnpflags (u_int at_flags, u_int mask)
 
int kern_sync (struct thread *td)
 
int sys_sync (struct thread *td, struct sync_args *uap)
 
int sys_quotactl (struct thread *td, struct quotactl_args *uap)
 
void statfs_scale_blocks (struct statfs *sf, long max_size)
 
static int kern_do_statfs (struct thread *td, struct mount *mp, struct statfs *buf)
 
int sys_statfs (struct thread *td, struct statfs_args *uap)
 
int kern_statfs (struct thread *td, const char *path, enum uio_seg pathseg, struct statfs *buf)
 
int sys_fstatfs (struct thread *td, struct fstatfs_args *uap)
 
int kern_fstatfs (struct thread *td, int fd, struct statfs *buf)
 
int sys_getfsstat (struct thread *td, struct getfsstat_args *uap)
 
int kern_getfsstat (struct thread *td, struct statfs **buf, size_t bufsize, size_t *countp, enum uio_seg bufseg, int mode)
 
int sys_fchdir (struct thread *td, struct fchdir_args *uap)
 
int sys_chdir (struct thread *td, struct chdir_args *uap)
 
int kern_chdir (struct thread *td, const char *path, enum uio_seg pathseg)
 
 SYSCTL_INT (_security_bsd, OID_AUTO, unprivileged_chroot, CTLFLAG_RW, &unprivileged_chroot, 0, "Unprivileged processes can use chroot(2)")
 
int sys_chroot (struct thread *td, struct chroot_args *uap)
 
int change_dir (struct vnode *vp, struct thread *td)
 
static __inline void flags_to_rights (int flags, cap_rights_t *rightsp)
 
int sys_open (struct thread *td, struct open_args *uap)
 
int sys_openat (struct thread *td, struct openat_args *uap)
 
int kern_openat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, int flags, int mode)
 
int sys_mknodat (struct thread *td, struct mknodat_args *uap)
 
int kern_mknodat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, int mode, dev_t dev)
 
int sys_mkfifo (struct thread *td, struct mkfifo_args *uap)
 
int sys_mkfifoat (struct thread *td, struct mkfifoat_args *uap)
 
int kern_mkfifoat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, int mode)
 
int sys_link (struct thread *td, struct link_args *uap)
 
int sys_linkat (struct thread *td, struct linkat_args *uap)
 
 SYSCTL_INT (_security_bsd, OID_AUTO, hardlink_check_uid, CTLFLAG_RW, &hardlink_check_uid, 0, "Unprivileged processes cannot create hard links to files owned by other " "users")
 
 SYSCTL_INT (_security_bsd, OID_AUTO, hardlink_check_gid, CTLFLAG_RW, &hardlink_check_gid, 0, "Unprivileged processes cannot create hard links to files owned by other " "groups")
 
static int can_hardlink (struct vnode *vp, struct ucred *cred)
 
int kern_linkat (struct thread *td, int fd1, int fd2, const char *path1, const char *path2, enum uio_seg segflag, int flag)
 
int sys_symlink (struct thread *td, struct symlink_args *uap)
 
int sys_symlinkat (struct thread *td, struct symlinkat_args *uap)
 
int kern_symlinkat (struct thread *td, const char *path1, int fd, const char *path2, enum uio_seg segflg)
 
int sys_undelete (struct thread *td, struct undelete_args *uap)
 
int sys_unlink (struct thread *td, struct unlink_args *uap)
 
static int kern_funlinkat_ex (struct thread *td, int dfd, const char *path, int fd, int flag, enum uio_seg pathseg, ino_t oldinum)
 
int sys_unlinkat (struct thread *td, struct unlinkat_args *uap)
 
int sys_funlinkat (struct thread *td, struct funlinkat_args *uap)
 
int kern_funlinkat (struct thread *td, int dfd, const char *path, int fd, enum uio_seg pathseg, int flag, ino_t oldinum)
 
int sys_lseek (struct thread *td, struct lseek_args *uap)
 
int kern_lseek (struct thread *td, int fd, off_t offset, int whence)
 
int sys_access (struct thread *td, struct access_args *uap)
 
struct faccessat_args sys_faccessat (struct thread *td, struct faccessat_args *uap)
 
int kern_accessat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, int flag, int amode)
 
int sys_eaccess (struct thread *td, struct eaccess_args *uap)
 
struct fstatat_args sys_fstatat (struct thread *td, struct fstatat_args *uap)
 
int kern_statat (struct thread *td, int flag, int fd, const char *path, enum uio_seg pathseg, struct stat *sbp, void(*hook)(struct vnode *vp, struct stat *sbp))
 
int sys_pathconf (struct thread *td, struct pathconf_args *uap)
 
int sys_lpathconf (struct thread *td, struct lpathconf_args *uap)
 
int kern_pathconf (struct thread *td, const char *path, enum uio_seg pathseg, int name, u_long flags, long *valuep)
 
int sys_readlink (struct thread *td, struct readlink_args *uap)
 
int sys_readlinkat (struct thread *td, struct readlinkat_args *uap)
 
int kern_readlinkat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, char *buf, enum uio_seg bufseg, size_t count)
 
int sys_chflags (struct thread *td, struct chflags_args *uap)
 
struct chflagsat_args sys_chflagsat (struct thread *td, struct chflagsat_args *uap)
 
int sys_lchflags (struct thread *td, struct lchflags_args *uap)
 
int sys_fchflags (struct thread *td, struct fchflags_args *uap)
 
int setfmode (struct thread *td, struct ucred *cred, struct vnode *vp, int mode)
 
int sys_chmod (struct thread *td, struct chmod_args *uap)
 
struct fchmodat_args sys_fchmodat (struct thread *td, struct fchmodat_args *uap)
 
int sys_lchmod (struct thread *td, struct lchmod_args *uap)
 
int kern_fchmodat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, mode_t mode, int flag)
 
int sys_fchmod (struct thread *td, struct fchmod_args *uap)
 
int setfown (struct thread *td, struct ucred *cred, struct vnode *vp, uid_t uid, gid_t gid)
 
int sys_chown (struct thread *td, struct chown_args *uap)
 
int sys_fchownat (struct thread *td, struct fchownat_args *uap)
 
int kern_fchownat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, int uid, int gid, int flag)
 
int sys_lchown (struct thread *td, struct lchown_args *uap)
 
int sys_fchown (struct thread *td, struct fchown_args *uap)
 
int sys_utimes (struct thread *td, struct utimes_args *uap)
 
int sys_futimesat (struct thread *td, struct futimesat_args *uap)
 
int kern_utimesat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, const struct timeval *tptr, enum uio_seg tptrseg)
 
int sys_lutimes (struct thread *td, struct lutimes_args *uap)
 
int kern_lutimes (struct thread *td, const char *path, enum uio_seg pathseg, const struct timeval *tptr, enum uio_seg tptrseg)
 
int sys_futimes (struct thread *td, struct futimes_args *uap)
 
int kern_futimes (struct thread *td, int fd, const struct timeval *tptr, enum uio_seg tptrseg)
 
int sys_futimens (struct thread *td, struct futimens_args *uap)
 
int kern_futimens (struct thread *td, int fd, const struct timespec *tptr, enum uio_seg tptrseg)
 
int sys_utimensat (struct thread *td, struct utimensat_args *uap)
 
int kern_utimensat (struct thread *td, int fd, const char *path, enum uio_seg pathseg, const struct timespec *tptr, enum uio_seg tptrseg, int flag)
 
int sys_truncate (struct thread *td, struct truncate_args *uap)
 
int kern_truncate (struct thread *td, const char *path, enum uio_seg pathseg, off_t length)
 
int kern_fsync (struct thread *td, int fd, bool fullsync)
 
int sys_fsync (struct thread *td, struct fsync_args *uap)
 
int sys_fdatasync (struct thread *td, struct fdatasync_args *uap)
 
int sys_rename (struct thread *td, struct rename_args *uap)
 
int sys_renameat (struct thread *td, struct renameat_args *uap)
 
int kern_renameat (struct thread *td, int oldfd, const char *old, int newfd, const char *new, enum uio_seg pathseg)
 
int sys_mkdir (struct thread *td, struct mkdir_args *uap)
 
int sys_mkdirat (struct thread *td, struct mkdirat_args *uap)
 
int kern_mkdirat (struct thread *td, int fd, const char *path, enum uio_seg segflg, int mode)
 
int sys_rmdir (struct thread *td, struct rmdir_args *uap)
 
int kern_frmdirat (struct thread *td, int dfd, const char *path, int fd, enum uio_seg pathseg, int flag)
 
int sys_getdirentries (struct thread *td, struct getdirentries_args *uap)
 
int kern_getdirentries (struct thread *td, int fd, char *buf, size_t count, off_t *basep, ssize_t *residp, enum uio_seg bufseg)
 
int sys_umask (struct thread *td, struct umask_args *uap)
 
int sys_revoke (struct thread *td, struct revoke_args *uap)
 
int getvnode_path (struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp)
 
int getvnode (struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp)
 
int sys_lgetfh (struct thread *td, struct lgetfh_args *uap)
 
int sys_getfh (struct thread *td, struct getfh_args *uap)
 
int sys_getfhat (struct thread *td, struct getfhat_args *uap)
 
int kern_getfhat (struct thread *td, int flags, int fd, const char *path, enum uio_seg pathseg, fhandle_t *fhp, enum uio_seg fhseg)
 
int sys_fhlink (struct thread *td, struct fhlink_args *uap)
 
int sys_fhlinkat (struct thread *td, struct fhlinkat_args *uap)
 
int sys_fhreadlink (struct thread *td, struct fhreadlink_args *uap)
 
int sys_fhopen (struct thread *td, struct fhopen_args *uap)
 
int kern_fhopen (struct thread *td, const struct fhandle *u_fhp, int flags)
 
int sys_fhstat (struct thread *td, struct fhstat_args *uap)
 
int kern_fhstat (struct thread *td, struct fhandle fh, struct stat *sb)
 
int sys_fhstatfs (struct thread *td, struct fhstatfs_args *uap)
 
int kern_fhstatfs (struct thread *td, fhandle_t fh, struct statfs *buf)
 
int kern_posix_fadvise (struct thread *td, int fd, off_t offset, off_t len, int advice)
 
int sys_posix_fadvise (struct thread *td, struct posix_fadvise_args *uap)
 
int kern_copy_file_range (struct thread *td, int infd, off_t *inoffp, int outfd, off_t *outoffp, size_t len, unsigned int flags)
 
int sys_copy_file_range (struct thread *td, struct copy_file_range_args *uap)
 

Variables

static int unprivileged_chroot = 0
 
int hardlink_check_uid = 0
 
static int hardlink_check_gid = 0
 
int dirfd
 
char * path
 
int amode
 
int flag
 
struct eaccess_args sys_faccessat
 
int fd
 
struct stat * buf
 
struct pathconf_args sys_fstatat
 
u_long flags
 
int atflag
 
struct lchflags_args sys_chflagsat
 
mode_t mode
 
struct lchmod_args sys_fchmodat
 

Macro Definition Documentation

◆ UTIMENS_EXIT

#define UTIMENS_EXIT   0x2

Definition at line 3147 of file vfs_syscalls.c.

◆ UTIMENS_NULL

#define UTIMENS_NULL   0x1

Definition at line 3146 of file vfs_syscalls.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ at2cnpflags()

static uint64_t at2cnpflags ( u_int  at_flags,
u_int  mask 
)
static

Definition at line 115 of file vfs_syscalls.c.

References mask, and res.

Referenced by kern_accessat(), kern_chflagsat(), kern_fchmodat(), kern_fchownat(), kern_frmdirat(), kern_funlinkat(), kern_getfhat(), kern_linkat(), kern_statat(), and kern_utimensat().

Here is the caller graph for this function:

◆ can_hardlink()

static int can_hardlink ( struct vnode *  vp,
struct ucred *  cred 
)
static

Definition at line 1554 of file vfs_syscalls.c.

References groupmember(), hardlink_check_gid, hardlink_check_uid, and priv_check_cred().

Referenced by kern_linkat_vp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ change_dir()

int change_dir ( struct vnode *  vp,
struct thread *  td 
)

Definition at line 1030 of file vfs_syscalls.c.

Referenced by do_jail_attach(), kern_chdir(), sys_chroot(), and sys_fchdir().

Here is the caller graph for this function:

◆ flags_to_rights()

static __inline void flags_to_rights ( int  flags,
cap_rights_t *  rightsp 
)
static

Definition at line 1048 of file vfs_syscalls.c.

References flags.

Referenced by kern_openat().

Here is the caller graph for this function:

◆ getutimens()

static int getutimens ( const struct timespec *  usrtsp,
enum uio_seg  tspseg,
struct timespec *  tsp,
int *  retflags 
)
static

Definition at line 3149 of file vfs_syscalls.c.

References UTIMENS_EXIT, UTIMENS_NULL, and vfs_timestamp().

Referenced by kern_futimens(), and kern_utimensat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getutimes()

static int getutimes ( const struct timeval *  usrtvp,
enum uio_seg  tvpseg,
struct timespec *  tsp 
)
static

Definition at line 3115 of file vfs_syscalls.c.

References vfs_timestamp().

Referenced by kern_futimes(), kern_lutimes(), and kern_utimesat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getvnode()

int getvnode ( struct thread *  td,
int  fd,
cap_rights_t *  rightsp,
struct file **  fpp 
)

Definition at line 4353 of file vfs_syscalls.c.

References fd, getvnode_path(), and path_fileops.

Referenced by kern_frmdirat(), kern_fsync(), kern_futimens(), kern_futimes(), kern_getdirentries(), sys___acl_aclcheck_fd(), sys___acl_delete_fd(), sys___acl_get_fd(), sys___acl_set_fd(), sys_fchflags(), and sysctl_ftry_reclaim_vnode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getvnode_path()

int getvnode_path ( struct thread *  td,
int  fd,
cap_rights_t *  rightsp,
struct file **  fpp 
)

Definition at line 4315 of file vfs_syscalls.c.

References badfileops, fd, and fget_unlocked().

Referenced by getvnode(), kern_fstatfs(), kern_funlinkat(), sys_extattr_delete_fd(), sys_extattr_get_fd(), sys_extattr_list_fd(), sys_extattr_set_fd(), and sys_fchdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_accessat()

int kern_accessat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
int  flag,
int  amode 
)

Definition at line 2120 of file vfs_syscalls.c.

References amode, at2cnpflags(), cap_fstat_rights, crdup(), crfree(), fd, flag, namei(), path, vn_access(), and vput().

Referenced by sys_access(), and sys_eaccess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_chdir()

int kern_chdir ( struct thread *  td,
const char *  path,
enum uio_seg  pathseg 
)

Definition at line 950 of file vfs_syscalls.c.

References change_dir(), namei(), path, pwd_chdir(), and vput().

Referenced by sys_chdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_chflagsat()

static int kern_chflagsat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
u_long  flags,
int  atflag 
)
static

Definition at line 2801 of file vfs_syscalls.c.

References at2cnpflags(), atflag, cap_fchflags_rights, fd, flags, namei(), path, setfflags(), and vrele().

Referenced by sys_chflags(), and sys_lchflags().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_copy_file_range()

int kern_copy_file_range ( struct thread *  td,
int  infd,
off_t *  inoffp,
int  outfd,
off_t *  outoffp,
size_t  len,
unsigned int  flags 
)

Definition at line 4889 of file vfs_syscalls.c.

References badfileops, cap_read_rights, cap_write_rights, fget_read(), fget_write(), flags, and vn_copy_file_range().

Referenced by sys_copy_file_range().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_do_statfs()

static int kern_do_statfs ( struct thread *  td,
struct mount *  mp,
struct statfs *  buf 
)
static

Definition at line 280 of file vfs_syscalls.c.

References buf, prison_enforce_statfs(), priv_check_cred_vfs_generation(), vfs_busy(), vfs_rel(), and vfs_unbusy().

Referenced by kern_fstatfs(), and kern_statfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fchmodat()

int kern_fchmodat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
mode_t  mode,
int  flag 
)

Definition at line 2932 of file vfs_syscalls.c.

References at2cnpflags(), cap_fchmod_rights, fd, flag, mode, namei(), path, setfmode(), and vrele().

Referenced by sys_chmod(), and sys_lchmod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fchownat()

int kern_fchownat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
int  uid,
int  gid,
int  flag 
)

Definition at line 3044 of file vfs_syscalls.c.

References at2cnpflags(), cap_fchown_rights, fd, flag, namei(), path, setfown(), and vrele().

Referenced by sys_chown(), sys_fchownat(), and sys_lchown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fhlinkat()

static int kern_fhlinkat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
fhandle_t *  fhp 
)
static

Definition at line 4491 of file vfs_syscalls.c.

References bwillwrite(), fd, kern_linkat_vp(), path, priv_check(), vfs_busyfs(), and vfs_unbusy().

Referenced by sys_fhlink(), and sys_fhlinkat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fhopen()

int kern_fhopen ( struct thread *  td,
const struct fhandle *  u_fhp,
int  flags 
)

Definition at line 4573 of file vfs_syscalls.c.

References badfileops, finit_vnode(), finstall(), flags, priv_check(), vfs_busyfs(), vfs_unbusy(), vn_open_vnode(), vnops, and vput().

Referenced by sys_fhopen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fhstat()

int kern_fhstat ( struct thread *  td,
struct fhandle  fh,
struct stat *  sb 
)

Definition at line 4671 of file vfs_syscalls.c.

References priv_check(), vfs_busyfs(), vfs_unbusy(), and vput().

Referenced by sys_fhstat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fhstatfs()

int kern_fhstatfs ( struct thread *  td,
fhandle_t  fh,
struct statfs *  buf 
)

Definition at line 4719 of file vfs_syscalls.c.

References buf, prison_canseemount(), priv_check(), vfs_busyfs(), vfs_unbusy(), and vput().

Referenced by sys_fhstatfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_frmdirat()

int kern_frmdirat ( struct thread *  td,
int  dfd,
const char *  path,
int  fd,
enum uio_seg  pathseg,
int  flag 
)

Definition at line 3885 of file vfs_syscalls.c.

References at2cnpflags(), bwillwrite(), cap_unlinkat_rights, fd, flag, getvnode(), namei(), NDFREE(), path, vfs_notify_upper(), vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by kern_funlinkat_ex(), and sys_rmdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fstatfs()

int kern_fstatfs ( struct thread *  td,
int  fd,
struct statfs *  buf 
)

Definition at line 372 of file vfs_syscalls.c.

References buf, cap_fstatfs_rights, fd, getvnode_path(), kern_do_statfs(), and vfs_ref_from_vp().

Referenced by sys_fstatfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_fsync()

int kern_fsync ( struct thread *  td,
int  fd,
bool  fullsync 
)

Definition at line 3541 of file vfs_syscalls.c.

References cap_fsync_rights, fd, getvnode(), vn_finished_write(), vn_lktype_write(), and vn_start_write().

Referenced by sys_fdatasync(), and sys_fsync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_funlinkat()

int kern_funlinkat ( struct thread *  td,
int  dfd,
const char *  path,
int  fd,
enum uio_seg  pathseg,
int  flag,
ino_t  oldinum 
)

Definition at line 1902 of file vfs_syscalls.c.

References at2cnpflags(), bwillwrite(), cap_no_rights, cap_unlinkat_rights, fd, flag, getvnode_path(), namei(), NDFREE(), path, vfs_notify_upper(), vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by kern_funlinkat_ex(), sys_unlink(), and vfs_mountroot_shuffle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_funlinkat_ex()

static int kern_funlinkat_ex ( struct thread *  td,
int  dfd,
const char *  path,
int  fd,
int  flag,
enum uio_seg  pathseg,
ino_t  oldinum 
)
static

Definition at line 1857 of file vfs_syscalls.c.

References fd, flag, kern_frmdirat(), kern_funlinkat(), and path.

Referenced by sys_funlinkat(), and sys_unlinkat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_futimens()

int kern_futimens ( struct thread *  td,
int  fd,
const struct timespec *  tptr,
enum uio_seg  tptrseg 
)

Definition at line 3371 of file vfs_syscalls.c.

References cap_futimes_rights, fd, flags, getutimens(), getvnode(), setutimes(), ts, UTIMENS_EXIT, and UTIMENS_NULL.

Referenced by sys_futimens().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_futimes()

int kern_futimes ( struct thread *  td,
int  fd,
const struct timeval *  tptr,
enum uio_seg  tptrseg 
)

Definition at line 3337 of file vfs_syscalls.c.

References cap_futimes_rights, fd, getutimes(), getvnode(), setutimes(), and ts.

Referenced by sys_futimes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_getdirentries()

int kern_getdirentries ( struct thread *  td,
int  fd,
char *  buf,
size_t  count,
off_t *  basep,
ssize_t *  residp,
enum uio_seg  bufseg 
)

Definition at line 4168 of file vfs_syscalls.c.

References buf, cap_read_rights, count, fd, foffset_lock(), foffset_unlock(), getvnode(), and vput().

Referenced by sys_getdirentries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_getfhat()

int kern_getfhat ( struct thread *  td,
int  flags,
int  fd,
const char *  path,
enum uio_seg  pathseg,
fhandle_t *  fhp,
enum uio_seg  fhseg 
)

Definition at line 4429 of file vfs_syscalls.c.

References at2cnpflags(), fd, flags, namei(), path, priv_check(), and vput().

Referenced by sys_getfh(), sys_getfhat(), and sys_lgetfh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_getfsstat()

int kern_getfsstat ( struct thread *  td,
struct statfs **  buf,
size_t  bufsize,
size_t *  countp,
enum uio_seg  bufseg,
int  mode 
)

Definition at line 427 of file vfs_syscalls.c.

References buf, count, free(), malloc(), maxcount, mode, mountlist, mountlist_mtx, prison_canseemount(), prison_enforce_statfs(), priv_check_cred_vfs_generation(), vfs_busy(), and vfs_unbusy().

Referenced by sys_getfsstat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_linkat()

int kern_linkat ( struct thread *  td,
int  fd1,
int  fd2,
const char *  path1,
const char *  path2,
enum uio_seg  segflag,
int  flag 
)

Definition at line 1582 of file vfs_syscalls.c.

References at2cnpflags(), bwillwrite(), cap_linkat_source_rights, flag, kern_linkat_vp(), namei(), NDFREE(), priv_check(), and vrele().

Referenced by sys_link(), and sys_linkat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_linkat_vp()

static int kern_linkat_vp ( struct thread *  td,
struct vnode *  vp,
int  fd,
const char *  path,
enum uio_seg  segflag 
)
static

Definition at line 1614 of file vfs_syscalls.c.

References can_hardlink(), cap_linkat_target_rights, fd, namei(), NDFREE(), path, vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by kern_fhlinkat(), and kern_linkat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_lseek()

int kern_lseek ( struct thread *  td,
int  fd,
off_t  offset,
int  whence 
)

Definition at line 2011 of file vfs_syscalls.c.

References cap_seek_rights, fd, and fget().

Referenced by sys_lseek().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_lutimes()

int kern_lutimes ( struct thread *  td,
const char *  path,
enum uio_seg  pathseg,
const struct timeval *  tptr,
enum uio_seg  tptrseg 
)

Definition at line 3302 of file vfs_syscalls.c.

References getutimes(), namei(), path, setutimes(), ts, and vrele().

Referenced by sys_lutimes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_mkdirat()

int kern_mkdirat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  segflg,
int  mode 
)

Definition at line 3823 of file vfs_syscalls.c.

References bwillwrite(), cap_mkdirat_rights, fd, mode, namei(), NDFREE(), path, vn_finished_write(), vn_start_write(), and vput().

Referenced by sys_mkdir(), and sys_mkdirat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_mkfifoat()

int kern_mkfifoat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
int  mode 
)

Definition at line 1455 of file vfs_syscalls.c.

References bwillwrite(), cap_mkfifoat_rights, fd, mode, namei(), NDFREE(), path, vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by kern_mknodat(), sys_mkfifo(), and sys_mkfifoat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_mknodat()

int kern_mknodat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
int  mode,
dev_t  dev 
)

Definition at line 1325 of file vfs_syscalls.c.

References bwillwrite(), cap_mknodat_rights, fd, kern_mkfifoat(), mode, namei(), NDFREE(), panic(), path, priv_check(), vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by sys_mknodat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_openat()

int kern_openat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
int  flags,
int  mode 
)

Definition at line 1120 of file vfs_syscalls.c.

References badfileops, dupfdopen(), falloc_abort(), fd, filecaps_free(), finit(), finit_vnode(), finstall_refed(), flags, flags_to_rights(), mode, NDFREE(), path, path_fileops, vhold(), vn_open(), vnops, and vunref().

Referenced by fdcheckstd(), parse_dir_md(), sys_open(), and sys_openat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_pathconf()

int kern_pathconf ( struct thread *  td,
const char *  path,
enum uio_seg  pathseg,
int  name,
u_long  flags,
long *  valuep 
)

Definition at line 2600 of file vfs_syscalls.c.

References flags, name, namei(), path, and vput().

Referenced by sys_lpathconf(), and sys_pathconf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_posix_fadvise()

int kern_posix_fadvise ( struct thread *  td,
int  fd,
off_t  offset,
off_t  len,
int  advice 
)

Definition at line 4757 of file vfs_syscalls.c.

References cap_no_rights, fd, fget(), free(), malloc(), and mtxpool_sleep.

Referenced by sys_posix_fadvise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_readlink_vp()

static int kern_readlink_vp ( struct vnode *  vp,
char *  buf,
enum uio_seg  bufseg,
size_t  count,
struct thread *  td 
)
static

Definition at line 2679 of file vfs_syscalls.c.

References buf, and count.

Referenced by kern_readlinkat(), and sys_fhreadlink().

Here is the caller graph for this function:

◆ kern_readlinkat()

int kern_readlinkat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
char *  buf,
enum uio_seg  bufseg,
size_t  count 
)

Definition at line 2651 of file vfs_syscalls.c.

References buf, count, fd, kern_readlink_vp(), namei(), path, and vput().

Referenced by sys_readlink(), and sys_readlinkat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_renameat()

int kern_renameat ( struct thread *  td,
int  oldfd,
const char *  old,
int  newfd,
const char *  new,
enum uio_seg  pathseg 
)

Definition at line 3662 of file vfs_syscalls.c.

References bwillwrite(), cap_renameat_source_rights, cap_renameat_target_rights, cap_unlinkat_rights, namei(), NDFREE(), vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by sys_rename(), and sys_renameat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_statat()

int kern_statat ( struct thread *  td,
int  flag,
int  fd,
const char *  path,
enum uio_seg  pathseg,
struct stat *  sbp,
void(*)(struct vnode *vp, struct stat *sbp)  hook 
)

Definition at line 2433 of file vfs_syscalls.c.

References at2cnpflags(), cap_fstat_rights, fd, flag, kern_fstat(), namei(), path, and vput().

Referenced by parse_dir_md().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_statfs()

int kern_statfs ( struct thread *  td,
const char *  path,
enum uio_seg  pathseg,
struct statfs *  buf 
)

Definition at line 331 of file vfs_syscalls.c.

References buf, kern_do_statfs(), namei(), path, vfs_ref_from_vp(), and vrele().

Referenced by sys_statfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_symlinkat()

int kern_symlinkat ( struct thread *  td,
const char *  path1,
int  fd,
const char *  path2,
enum uio_seg  segflg 
)

Definition at line 1722 of file vfs_syscalls.c.

References bwillwrite(), cap_symlinkat_rights, fd, namei(), namei_zone, NDFREE(), vn_finished_write(), vn_start_write(), vput(), and vrele().

Referenced by sys_symlink(), sys_symlinkat(), and vfs_mountroot_devfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_sync()

int kern_sync ( struct thread *  td)

Definition at line 139 of file vfs_syscalls.c.

References mountlist, mountlist_mtx, vfs_busy(), vfs_periodic(), vfs_unbusy(), vn_finished_write(), and vn_start_write().

Referenced by bufshutdown(), and sys_sync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_truncate()

int kern_truncate ( struct thread *  td,
const char *  path,
enum uio_seg  pathseg,
off_t  length 
)

Definition at line 3458 of file vfs_syscalls.c.

References namei(), NDFREE(), path, vn_finished_write(), vn_start_write(), vn_writechk(), and vrele().

Referenced by sys_truncate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_utimensat()

int kern_utimensat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
const struct timespec *  tptr,
enum uio_seg  tptrseg,
int  flag 
)

Definition at line 3408 of file vfs_syscalls.c.

References at2cnpflags(), cap_futimes_rights, fd, flag, flags, getutimens(), namei(), path, setutimes(), ts, UTIMENS_EXIT, UTIMENS_NULL, and vrele().

Referenced by sys_utimensat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_utimesat()

int kern_utimesat ( struct thread *  td,
int  fd,
const char *  path,
enum uio_seg  pathseg,
const struct timeval *  tptr,
enum uio_seg  tptrseg 
)

Definition at line 3264 of file vfs_syscalls.c.

References cap_futimes_rights, fd, getutimes(), namei(), path, setutimes(), ts, and vrele().

Referenced by sys_futimesat(), and sys_utimes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_FADVISE  ,
"fadvise"  ,
"posix_fadvise(2) information"   
)

◆ setfflags()

static int setfflags ( struct thread *  td,
struct vnode *  vp,
u_long  flags 
)
static

Definition at line 2713 of file vfs_syscalls.c.

References flags, priv_check(), vn_finished_write(), and vn_start_write().

Referenced by kern_chflagsat(), and sys_fchflags().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setfmode()

int setfmode ( struct thread *  td,
struct ucred *  cred,
struct vnode *  vp,
int  mode 
)

Definition at line 2860 of file vfs_syscalls.c.

References mode, vn_finished_write(), and vn_start_write().

Referenced by kern_fchmodat(), and vn_chmod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setfown()

int setfown ( struct thread *  td,
struct ucred *  cred,
struct vnode *  vp,
uid_t  uid,
gid_t  gid 
)

Definition at line 2984 of file vfs_syscalls.c.

References vn_finished_write(), and vn_start_write().

Referenced by kern_fchownat(), and vn_chown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setutimes()

static int setutimes ( struct thread *  td,
struct vnode *  vp,
const struct timespec *  ts,
int  numtimes,
int  nullflag 
)
static

Definition at line 3193 of file vfs_syscalls.c.

References ts, vn_finished_write(), and vn_start_write().

Referenced by kern_futimens(), kern_futimes(), kern_lutimes(), kern_utimensat(), and kern_utimesat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statfs_scale_blocks()

void statfs_scale_blocks ( struct statfs *  sf,
long  max_size 
)

Definition at line 245 of file vfs_syscalls.c.

References count.

◆ sys_access()

int sys_access ( struct thread *  td,
struct access_args uap 
)

Definition at line 2096 of file vfs_syscalls.c.

References access_args::amode, kern_accessat(), and access_args::path.

Here is the call graph for this function:

◆ sys_chdir()

int sys_chdir ( struct thread *  td,
struct chdir_args uap 
)

Definition at line 943 of file vfs_syscalls.c.

References kern_chdir(), and chdir_args::path.

Here is the call graph for this function:

◆ sys_chflags()

int sys_chflags ( struct thread *  td,
struct chflags_args uap 
)

Definition at line 2760 of file vfs_syscalls.c.

References chflags_args::flags, kern_chflagsat(), and chflags_args::path.

Here is the call graph for this function:

◆ sys_chflagsat()

struct chflagsat_args sys_chflagsat ( struct thread *  td,
struct chflagsat_args uap 
)

Definition at line 2760 of file vfs_syscalls.c.

◆ sys_chmod()

int sys_chmod ( struct thread *  td,
struct chmod_args uap 
)

Definition at line 2891 of file vfs_syscalls.c.

References kern_fchmodat(), chmod_args::mode, and chmod_args::path.

Here is the call graph for this function:

◆ sys_chown()

int sys_chown ( struct thread *  td,
struct chown_args uap 
)

Definition at line 3019 of file vfs_syscalls.c.

References chown_args::gid, kern_fchownat(), chown_args::path, and chown_args::uid.

Here is the call graph for this function:

◆ sys_chroot()

int sys_chroot ( struct thread *  td,
struct chroot_args uap 
)

Definition at line 983 of file vfs_syscalls.c.

References change_dir(), namei(), chroot_args::path, priv_check(), pwd_chroot(), unprivileged_chroot, vput(), and vrele().

Here is the call graph for this function:

◆ sys_copy_file_range()

int sys_copy_file_range ( struct thread *  td,
struct copy_file_range_args *  uap 
)

Definition at line 5007 of file vfs_syscalls.c.

References kern_copy_file_range().

Here is the call graph for this function:

◆ sys_eaccess()

int sys_eaccess ( struct thread *  td,
struct eaccess_args uap 
)

Definition at line 2176 of file vfs_syscalls.c.

References eaccess_args::amode, kern_accessat(), and eaccess_args::path.

Here is the call graph for this function:

◆ sys_faccessat()

struct faccessat_args sys_faccessat ( struct thread *  td,
struct faccessat_args uap 
)

Definition at line 2096 of file vfs_syscalls.c.

◆ sys_fchdir()

int sys_fchdir ( struct thread *  td,
struct fchdir_args uap 
)

Definition at line 897 of file vfs_syscalls.c.

References cap_fchdir_rights, change_dir(), fchdir_args::fd, getvnode_path(), pwd_chdir(), vfs_busy(), vfs_unbusy(), vput(), and vref().

Here is the call graph for this function:

◆ sys_fchflags()

int sys_fchflags ( struct thread *  td,
struct fchflags_args uap 
)

Definition at line 2833 of file vfs_syscalls.c.

References cap_fchflags_rights, fchflags_args::fd, fchflags_args::flags, getvnode(), and setfflags().

Here is the call graph for this function:

◆ sys_fchmod()

int sys_fchmod ( struct thread *  td,
struct fchmod_args uap 
)

Definition at line 2964 of file vfs_syscalls.c.

References cap_fchmod_rights, fchmod_args::fd, fget(), and fchmod_args::mode.

Here is the call graph for this function:

◆ sys_fchmodat()

struct fchmodat_args sys_fchmodat ( struct thread *  td,
struct fchmodat_args uap 
)

Definition at line 2891 of file vfs_syscalls.c.

◆ sys_fchown()

int sys_fchown ( struct thread *  td,
struct fchown_args uap 
)

Definition at line 3096 of file vfs_syscalls.c.

References cap_fchown_rights, fchown_args::fd, fget(), fchown_args::gid, and fchown_args::uid.

Here is the call graph for this function:

◆ sys_fchownat()

int sys_fchownat ( struct thread *  td,
struct fchownat_args uap 
)

Definition at line 3036 of file vfs_syscalls.c.

References fchownat_args::fd, fchownat_args::flag, fchownat_args::gid, kern_fchownat(), fchownat_args::path, and fchownat_args::uid.

Here is the call graph for this function:

◆ sys_fdatasync()

int sys_fdatasync ( struct thread *  td,
struct fdatasync_args *  uap 
)

Definition at line 3594 of file vfs_syscalls.c.

References kern_fsync().

Here is the call graph for this function:

◆ sys_fhlink()

int sys_fhlink ( struct thread *  td,
struct fhlink_args uap 
)

Definition at line 4470 of file vfs_syscalls.c.

References fhlink_args::fhp, kern_fhlinkat(), and fhlink_args::to.

Here is the call graph for this function:

◆ sys_fhlinkat()

int sys_fhlinkat ( struct thread *  td,
struct fhlinkat_args uap 
)

Definition at line 4484 of file vfs_syscalls.c.

References fhlinkat_args::fhp, kern_fhlinkat(), fhlinkat_args::to, and fhlinkat_args::tofd.

Here is the call graph for this function:

◆ sys_fhopen()

int sys_fhopen ( struct thread *  td,
struct fhopen_args uap 
)

Definition at line 4567 of file vfs_syscalls.c.

References fhopen_args::flags, kern_fhopen(), and fhopen_args::u_fhp.

Here is the call graph for this function:

◆ sys_fhreadlink()

int sys_fhreadlink ( struct thread *  td,
struct fhreadlink_args uap 
)

Definition at line 4527 of file vfs_syscalls.c.

References fhreadlink_args::buf, fhreadlink_args::bufsize, fhreadlink_args::fhp, kern_readlink_vp(), priv_check(), vfs_busyfs(), vfs_unbusy(), and vput().

Here is the call graph for this function:

◆ sys_fhstat()

int sys_fhstat ( struct thread *  td,
struct fhstat_args uap 
)

Definition at line 4655 of file vfs_syscalls.c.

References kern_fhstat(), fhstat_args::sb, and fhstat_args::u_fhp.

Here is the call graph for this function:

◆ sys_fhstatfs()

int sys_fhstatfs ( struct thread *  td,
struct fhstatfs_args uap 
)

Definition at line 4701 of file vfs_syscalls.c.

References fhstatfs_args::buf, free(), kern_fhstatfs(), malloc(), and fhstatfs_args::u_fhp.

Here is the call graph for this function:

◆ sys_fstatat()

struct fstatat_args sys_fstatat ( struct thread *  td,
struct fstatat_args uap 
)

Definition at line 2176 of file vfs_syscalls.c.

◆ sys_fstatfs()

int sys_fstatfs ( struct thread *  td,
struct fstatfs_args uap 
)

Definition at line 358 of file vfs_syscalls.c.

References fstatfs_args::buf, fstatfs_args::fd, free(), kern_fstatfs(), and malloc().

Here is the call graph for this function:

◆ sys_fsync()

int sys_fsync ( struct thread *  td,
struct fsync_args uap 
)

Definition at line 3587 of file vfs_syscalls.c.

References fsync_args::fd, and kern_fsync().

Here is the call graph for this function:

◆ sys_funlinkat()

int sys_funlinkat ( struct thread *  td,
struct funlinkat_args uap 
)

Definition at line 1894 of file vfs_syscalls.c.

References funlinkat_args::dfd, funlinkat_args::fd, funlinkat_args::flag, kern_funlinkat_ex(), and funlinkat_args::path.

Here is the call graph for this function:

◆ sys_futimens()

int sys_futimens ( struct thread *  td,
struct futimens_args *  uap 
)

Definition at line 3364 of file vfs_syscalls.c.

References kern_futimens().

Here is the call graph for this function:

◆ sys_futimes()

int sys_futimes ( struct thread *  td,
struct futimes_args uap 
)

Definition at line 3330 of file vfs_syscalls.c.

References futimes_args::fd, kern_futimes(), and futimes_args::tptr.

Here is the call graph for this function:

◆ sys_futimesat()

int sys_futimesat ( struct thread *  td,
struct futimesat_args uap 
)

Definition at line 3256 of file vfs_syscalls.c.

References futimesat_args::fd, kern_utimesat(), futimesat_args::path, and futimesat_args::times.

Here is the call graph for this function:

◆ sys_getdirentries()

int sys_getdirentries ( struct thread *  td,
struct getdirentries_args *  uap 
)

Definition at line 4153 of file vfs_syscalls.c.

References kern_getdirentries().

Here is the call graph for this function:

◆ sys_getfh()

int sys_getfh ( struct thread *  td,
struct getfh_args uap 
)

Definition at line 4398 of file vfs_syscalls.c.

References getfh_args::fhp, getfh_args::fname, and kern_getfhat().

Here is the call graph for this function:

◆ sys_getfhat()

int sys_getfhat ( struct thread *  td,
struct getfhat_args uap 
)

Definition at line 4421 of file vfs_syscalls.c.

References getfhat_args::fd, getfhat_args::fhp, getfhat_args::flags, kern_getfhat(), and getfhat_args::path.

Here is the call graph for this function:

◆ sys_getfsstat()

int sys_getfsstat ( struct thread *  td,
struct getfsstat_args uap 
)

Definition at line 407 of file vfs_syscalls.c.

References getfsstat_args::buf, getfsstat_args::bufsize, count, kern_getfsstat(), and getfsstat_args::mode.

Here is the call graph for this function:

◆ sys_lchflags()

int sys_lchflags ( struct thread *  td,
struct lchflags_args uap 
)

Definition at line 2793 of file vfs_syscalls.c.

References lchflags_args::flags, kern_chflagsat(), and lchflags_args::path.

Here is the call graph for this function:

◆ sys_lchmod()

int sys_lchmod ( struct thread *  td,
struct lchmod_args uap 
)

Definition at line 2924 of file vfs_syscalls.c.

References kern_fchmodat(), lchmod_args::mode, and lchmod_args::path.

Here is the call graph for this function:

◆ sys_lchown()

int sys_lchown ( struct thread *  td,
struct lchown_args uap 
)

Definition at line 3078 of file vfs_syscalls.c.

References lchown_args::gid, kern_fchownat(), lchown_args::path, and lchown_args::uid.

Here is the call graph for this function:

◆ sys_lgetfh()

int sys_lgetfh ( struct thread *  td,
struct lgetfh_args uap 
)

Definition at line 4384 of file vfs_syscalls.c.

References lgetfh_args::fhp, lgetfh_args::fname, and kern_getfhat().

Here is the call graph for this function:

◆ sys_link()

int sys_link ( struct thread *  td,
struct link_args uap 
)

Definition at line 1518 of file vfs_syscalls.c.

References kern_linkat(), link_args::link, and link_args::path.

Here is the call graph for this function:

◆ sys_linkat()

int sys_linkat ( struct thread *  td,
struct linkat_args uap 
)

Definition at line 1535 of file vfs_syscalls.c.

References linkat_args::fd1, linkat_args::fd2, linkat_args::flag, kern_linkat(), linkat_args::path1, and linkat_args::path2.

Here is the call graph for this function:

◆ sys_lpathconf()

int sys_lpathconf ( struct thread *  td,
struct lpathconf_args uap 
)

Definition at line 2587 of file vfs_syscalls.c.

References kern_pathconf(), lpathconf_args::name, lpathconf_args::path, and value.

Here is the call graph for this function:

◆ sys_lseek()

int sys_lseek ( struct thread *  td,
struct lseek_args uap 
)

Definition at line 2004 of file vfs_syscalls.c.

References lseek_args::fd, kern_lseek(), lseek_args::offset, and lseek_args::whence.

Here is the call graph for this function:

◆ sys_lutimes()

int sys_lutimes ( struct thread *  td,
struct lutimes_args uap 
)

Definition at line 3294 of file vfs_syscalls.c.

References kern_lutimes(), lutimes_args::path, and lutimes_args::tptr.

Here is the call graph for this function:

◆ sys_mkdir()

int sys_mkdir ( struct thread *  td,
struct mkdir_args uap 
)

Definition at line 3801 of file vfs_syscalls.c.

References kern_mkdirat(), mkdir_args::mode, and mkdir_args::path.

Here is the call graph for this function:

◆ sys_mkdirat()

int sys_mkdirat ( struct thread *  td,
struct mkdirat_args uap 
)

Definition at line 3816 of file vfs_syscalls.c.

References mkdirat_args::fd, kern_mkdirat(), mkdirat_args::mode, and mkdirat_args::path.

Here is the call graph for this function:

◆ sys_mkfifo()

int sys_mkfifo ( struct thread *  td,
struct mkfifo_args uap 
)

Definition at line 1432 of file vfs_syscalls.c.

References kern_mkfifoat(), mkfifo_args::mode, and mkfifo_args::path.

Here is the call graph for this function:

◆ sys_mkfifoat()

int sys_mkfifoat ( struct thread *  td,
struct mkfifoat_args uap 
)

Definition at line 1447 of file vfs_syscalls.c.

References mkfifoat_args::fd, kern_mkfifoat(), mkfifoat_args::mode, and mkfifoat_args::path.

Here is the call graph for this function:

◆ sys_mknodat()

int sys_mknodat ( struct thread *  td,
struct mknodat_args uap 
)

Definition at line 1297 of file vfs_syscalls.c.

References mknodat_args::dev, mknodat_args::fd, kern_mknodat(), mknodat_args::mode, and mknodat_args::path.

Here is the call graph for this function:

◆ sys_open()

int sys_open ( struct thread *  td,
struct open_args uap 
)

Definition at line 1095 of file vfs_syscalls.c.

References open_args::flags, kern_openat(), open_args::mode, and open_args::path.

Here is the call graph for this function:

◆ sys_openat()

int sys_openat ( struct thread *  td,
struct openat_args uap 
)

Definition at line 1111 of file vfs_syscalls.c.

References openat_args::fd, openat_args::flag, kern_openat(), openat_args::mode, and openat_args::path.

Here is the call graph for this function:

◆ sys_pathconf()

int sys_pathconf ( struct thread *  td,
struct pathconf_args uap 
)

Definition at line 2568 of file vfs_syscalls.c.

References kern_pathconf(), pathconf_args::name, pathconf_args::path, and value.

Here is the call graph for this function:

◆ sys_posix_fadvise()

int sys_posix_fadvise ( struct thread *  td,
struct posix_fadvise_args *  uap 
)

Definition at line 4879 of file vfs_syscalls.c.

References kern_posix_error(), and kern_posix_fadvise().

Here is the call graph for this function:

◆ sys_quotactl()

int sys_quotactl ( struct thread *  td,
struct quotactl_args uap 
)

Definition at line 194 of file vfs_syscalls.c.

References quotactl_args::arg, quotactl_args::cmd, namei(), NDFREE(), quotactl_args::path, prison_allow(), quotactl_args::uid, vfs_busy(), vfs_ref(), vfs_rel(), vfs_unbusy(), and vput().

Here is the call graph for this function:

◆ sys_readlink()

int sys_readlink ( struct thread *  td,
struct readlink_args uap 
)

Definition at line 2628 of file vfs_syscalls.c.

References readlink_args::buf, readlink_args::count, kern_readlinkat(), and readlink_args::path.

Here is the call graph for this function:

◆ sys_readlinkat()

int sys_readlinkat ( struct thread *  td,
struct readlinkat_args uap 
)

Definition at line 2643 of file vfs_syscalls.c.

References readlinkat_args::buf, readlinkat_args::bufsize, readlinkat_args::fd, kern_readlinkat(), and readlinkat_args::path.

Here is the call graph for this function:

◆ sys_rename()

int sys_rename ( struct thread *  td,
struct rename_args uap 
)

Definition at line 3611 of file vfs_syscalls.c.

References rename_args::from, kern_renameat(), and rename_args::to.

Here is the call graph for this function:

◆ sys_renameat()

int sys_renameat ( struct thread *  td,
struct renameat_args uap 
)

Definition at line 3627 of file vfs_syscalls.c.

References kern_renameat(), renameat_args::new, renameat_args::newfd, renameat_args::old, and renameat_args::oldfd.

Here is the call graph for this function:

◆ sys_revoke()

int sys_revoke ( struct thread *  td,
struct revoke_args uap 
)

Definition at line 4272 of file vfs_syscalls.c.

References namei(), revoke_args::path, priv_check(), and vput().

Here is the call graph for this function:

◆ sys_rmdir()

int sys_rmdir ( struct thread *  td,
struct rmdir_args uap 
)

Definition at line 3877 of file vfs_syscalls.c.

References kern_frmdirat(), and rmdir_args::path.

Here is the call graph for this function:

◆ sys_statfs()

int sys_statfs ( struct thread *  td,
struct statfs_args uap 
)

Definition at line 317 of file vfs_syscalls.c.

References statfs_args::buf, free(), kern_statfs(), malloc(), and statfs_args::path.

Here is the call graph for this function:

◆ sys_symlink()

int sys_symlink ( struct thread *  td,
struct symlink_args uap 
)

Definition at line 1699 of file vfs_syscalls.c.

References kern_symlinkat(), symlink_args::link, and symlink_args::path.

Here is the call graph for this function:

◆ sys_symlinkat()

int sys_symlinkat ( struct thread *  td,
struct symlinkat_args uap 
)

Definition at line 1714 of file vfs_syscalls.c.

References symlinkat_args::fd, kern_symlinkat(), and symlinkat_args::path2.

Here is the call graph for this function:

◆ sys_sync()

int sys_sync ( struct thread *  td,
struct sync_args uap 
)

Definition at line 176 of file vfs_syscalls.c.

References kern_sync().

Here is the call graph for this function:

◆ sys_truncate()

int sys_truncate ( struct thread *  td,
struct truncate_args uap 
)

Definition at line 3451 of file vfs_syscalls.c.

References kern_truncate(), truncate_args::length, and truncate_args::path.

Here is the call graph for this function:

◆ sys_umask()

int sys_umask ( struct thread *  td,
struct umask_args uap 
)

Definition at line 4250 of file vfs_syscalls.c.

References umask_args::newmask.

◆ sys_undelete()

int sys_undelete ( struct thread *  td,
struct undelete_args uap 
)

Definition at line 1799 of file vfs_syscalls.c.

References bwillwrite(), namei(), NDFREE(), undelete_args::path, vn_finished_write(), vn_start_write(), vput(), and vrele().

Here is the call graph for this function:

◆ sys_unlink()

int sys_unlink ( struct thread *  td,
struct unlink_args uap 
)

Definition at line 1849 of file vfs_syscalls.c.

References kern_funlinkat(), and unlink_args::path.

Here is the call graph for this function:

◆ sys_unlinkat()

int sys_unlinkat ( struct thread *  td,
struct unlinkat_args uap 
)

Definition at line 1878 of file vfs_syscalls.c.

References unlinkat_args::fd, unlinkat_args::flag, kern_funlinkat_ex(), and unlinkat_args::path.

Here is the call graph for this function:

◆ sys_utimensat()

int sys_utimensat ( struct thread *  td,
struct utimensat_args *  uap 
)

Definition at line 3400 of file vfs_syscalls.c.

References kern_utimensat().

Here is the call graph for this function:

◆ sys_utimes()

int sys_utimes ( struct thread *  td,
struct utimes_args uap 
)

Definition at line 3241 of file vfs_syscalls.c.

References kern_utimesat(), utimes_args::path, and utimes_args::tptr.

Here is the call graph for this function:

◆ SYSCTL_INT() [1/3]

SYSCTL_INT ( _security_bsd  ,
OID_AUTO  ,
hardlink_check_gid  ,
CTLFLAG_RW  ,
hardlink_check_gid,
,
"Unprivileged processes cannot create hard links to files owned by other " "groups"   
)

◆ SYSCTL_INT() [2/3]

SYSCTL_INT ( _security_bsd  ,
OID_AUTO  ,
hardlink_check_uid  ,
CTLFLAG_RW  ,
hardlink_check_uid,
,
"Unprivileged processes cannot create hard links to files owned by other " "users"   
)

◆ SYSCTL_INT() [3/3]

SYSCTL_INT ( _security_bsd  ,
OID_AUTO  ,
unprivileged_chroot  ,
CTLFLAG_RW  ,
unprivileged_chroot,
,
"Unprivileged processes can use chroot(2)"   
)

◆ vn_access()

static int vn_access ( struct vnode *  vp,
int  user_flags,
struct ucred *  cred,
struct thread *  td 
)
static

Definition at line 2059 of file vfs_syscalls.c.

References accmode, and vn_writechk().

Referenced by kern_accessat().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ amode

int amode

Definition at line 2115 of file vfs_syscalls.c.

Referenced by acl_nfs4_sync_acl_from_mode_draft(), and kern_accessat().

◆ atflag

int atflag

Definition at line 2780 of file vfs_syscalls.c.

Referenced by kern_chflagsat().

◆ buf

struct stat* buf

Definition at line 2423 of file vfs_syscalls.c.

Referenced by _sglist_append_buf(), aio_biocleanup(), aio_qbio(), be_uuid_dec(), be_uuid_enc(), bitset_strprint(), bitset_strscan(), bnoreuselist(), buf_vlist_add(), bus_dmamap_load(), cluster_callback(), cluster_collectbufs(), cluster_rbuild(), cluster_read(), cluster_wbuild(), cluster_write(), compress_chunk(), constty_set(), cpusetobj_strprint(), cpusetobj_strscan(), device_log(), device_printf(), dump_append(), dump_write_headers(), dumpdevname_sysctl_handler(), dumpsys_buf_seek(), fail_point_set(), fail_point_sysctl(), fail_sysctl_drain_func(), flushbuflist(), gbincore(), gbincore_unlocked(), get_fpregset(), get_prstatus(), getcreddomainname(), getcredhostname(), getcredhostuuid(), getenv_array(), init_static_kenv(), kdb_sysctl_current(), kdb_sysctl_panic_str(), kenv_release(), kern___realpathat(), kern_alternate_path(), kern_do_statfs(), kern_fhstatfs(), kern_fstatfs(), kern_getdirentries(), kern_getfsstat(), kern_pread(), kern_ptrace(), kern_pwrite(), kern_readlink_vp(), kern_readlinkat(), kern_recvfrom(), kern_setenv(), kern_shmctl(), kern_shmctl_locked(), kern_statfs(), kmsan_report_hook(), kmsan_report_inline(), kproc_kthread_add(), ktls_alloc_thread(), ktls_buffer_alloc(), le_uuid_dec(), le_uuid_enc(), linker_ddb_search_symbol_name(), linker_debug_search_symbol_name(), linker_search_symbol_name(), linker_search_symbol_name_flags(), logread(), m_common_hash_gethdr(), m_devget(), m_ether_tcpip_hash(), m_extadd(), m_tcpip_hash(), mb_unmapped_compress(), memset_early(), mount_devctl_event(), mqfs_read(), msgbuf_addstr(), msgbuf_getbytes(), msgbuf_peekbytes(), note_threadmd(), parse_notes(), physio(), populate_note(), preload_dump(), printf_uuid(), prison0_init(), proc_iop(), proc_read_regset(), proc_read_string(), proc_readmem(), proc_write_regset(), proc_writemem(), putnote(), Report(), sbuf_bcat(), sbuf_bcpy(), sbuf_new(), sbuf_new_for_sysctl(), sbuf_printf_uuid(), sbuf_put_bytes(), set_fpregset(), set_prstatus(), sglist_append(), sglist_append_user(), sglist_build(), sglist_count(), snprintf_uuid(), sockargs(), sooptcopyin(), sooptcopyout(), sprintf(), stats_tpl_id2name(), stats_tpl_sample_rates(), stats_v1_blob_tostr(), stats_v1_itercb_tostr_freeform(), stats_v1_itercb_tostr_json(), stats_voistatdata_hist_tostr(), stats_voistatdata_tdgst_tostr(), stats_voistatdata_tostr(), sys___getcwd(), sys_shmctl(), sysctl_build_id(), sysctl_debug_ktr_entries(), sysctl_debug_witness_channel(), sysctl_handle_domainset(), sysctl_kern_arnd(), sysctl_kern_eventtimer_timer(), sysctl_kern_msgbuf(), sysctl_sysctl_name(), sysctl_sysctl_name2oid(), sysctl_try_reclaim_vnode(), sysctl_warn_reuse(), termteken_respond(), trace_cmp(), trace_pc(), ttydisc_getc(), ttydisc_getc_uio(), ttydisc_rint_bypass(), ttydisc_rint_simple(), ttyinq_write(), ttyinq_write_nofrag(), ttyoutq_read(), ttyoutq_write(), ttyoutq_write_nofrag(), uiomove_frombuf(), uipc_bindat(), unp_connectat(), v_inval_buf_range_locked(), vfs_getopt(), vfs_mountroot_readconf(), vn_commname(), vn_extattr_get(), vn_extattr_set(), vn_fsync_buf(), vn_fullpath(), vn_fullpath_any(), vn_fullpath_any_smr(), vn_fullpath_dir(), vn_fullpath_global(), vn_fullpath_hardlink(), vn_getcwd(), vn_printf(), vn_vptocnp(), vop_stdallocate(), vop_stdvptocnp(), vpanic(), vsprintf(), vsscanf(), vtruncbuf(), witness_checkorder(), and witness_debugger().

◆ dirfd

int dirfd

Definition at line 2113 of file vfs_syscalls.c.

Referenced by kern_alternate_path(), kern_bindat(), and kern_connectat().

◆ fd

int fd

Definition at line 2421 of file vfs_syscalls.c.

Referenced by _fget(), _fgetvp(), _finstall(), _getmq(), aio_aqueue(), close_range_cloexec(), close_range_impl(), closefp(), closefp_hl(), closefp_impl(), do_fork(), dofileread(), dofilewrite(), export_file_to_kinfo(), export_file_to_sb(), export_vnode_to_kinfo(), export_vnode_to_sb(), falloc_caps(), fdalloc(), fdfree(), fdisused(), fdunused(), fdused(), fdused_init(), fget(), fget_cap(), fget_cap_noref(), fget_fcntl(), fget_mmap(), fget_only_user(), fget_read(), fget_unlocked(), fget_unlocked_seq(), fget_write(), fgetvp(), fgetvp_exec(), fgetvp_lookup_smr(), fgetvp_read(), fgetvp_rights(), finstall(), finstall_refed(), getmq(), getmq_read(), getmq_write(), getsock_cap(), getvnode(), getvnode_path(), kern___realpathat(), kern_accept4(), kern_accessat(), kern_bindat(), kern_chflagsat(), kern_close(), kern_connectat(), kern_fchmodat(), kern_fchownat(), kern_fcntl(), kern_fcntl_freebsd(), kern_fhlinkat(), kern_fpathconf(), kern_frmdirat(), kern_fspacectl(), kern_fstat(), kern_fstatfs(), kern_fsync(), kern_ftruncate(), kern_funlinkat(), kern_funlinkat_ex(), kern_futimens(), kern_futimes(), kern_getdirentries(), kern_getfhat(), kern_getpeername(), kern_getsockname(), kern_ioctl(), kern_kevent(), kern_kmq_open(), kern_kqueue(), kern_linkat_vp(), kern_lseek(), kern_mkdirat(), kern_mkfifoat(), kern_mknodat(), kern_openat(), kern_pdgetpid(), kern_pipe(), kern_posix_fadvise(), kern_posix_fallocate(), kern_pread(), kern_preadv(), kern_pwrite(), kern_pwritev(), kern_readlinkat(), kern_readv(), kern_shm_open2(), kern_socket(), kern_socketpair(), kern_specialfd(), kern_statat(), kern_symlinkat(), kern_utimensat(), kern_utimesat(), kern_writev(), knote_fdclose(), kqfd_register(), kqueue_expand(), ksem_create(), ksem_create_copyout_semid(), m_dispose_extcontrolm(), mqueue_fdclose(), notifier_remove(), notifier_search(), parse_dir_md(), pollrescan(), procdesc_find(), selrescan(), selscan(), sobindat(), soconnectat(), sys_pdfork(), sys_posix_openpt(), sysctl_ftry_reclaim_vnode(), ttyhook_register(), uipc_bindat(), uipc_connectat(), umtx_shm(), and unp_connectat().

◆ flag

◆ flags

◆ hardlink_check_gid

int hardlink_check_gid = 0
static

Definition at line 1547 of file vfs_syscalls.c.

Referenced by can_hardlink().

◆ hardlink_check_uid

int hardlink_check_uid = 0

Definition at line 1542 of file vfs_syscalls.c.

Referenced by can_hardlink().

◆ mode

◆ path

◆ sys_chflagsat

struct lchflags_args sys_chflagsat

◆ sys_faccessat

struct eaccess_args sys_faccessat

◆ sys_fchmodat

struct lchmod_args sys_fchmodat

◆ sys_fstatat

struct pathconf_args sys_fstatat

◆ unprivileged_chroot

int unprivileged_chroot = 0
static

Definition at line 970 of file vfs_syscalls.c.

Referenced by sys_chroot().