diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-27 13:58:44 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-27 13:58:44 +0000 |
commit | da78c9e4a2e1689a4d400553bb5f6aa0537c5f49 (patch) | |
tree | 18c823b27ab8bd9a1cd03dcca0ea5348975f3971 /sys/kern/vfs_syscalls.c | |
parent | 3b6551a921beb7f1408f05c3730aa5802bd6e79c (diff) | |
download | FreeBSD-src-da78c9e4a2e1689a4d400553bb5f6aa0537c5f49.zip FreeBSD-src-da78c9e4a2e1689a4d400553bb5f6aa0537c5f49.tar.gz |
Replace AUDIT_ARG() with variable argument macros with a set more more
specific macros for each audit argument type. This makes it easier to
follow call-graphs, especially for automated analysis tools (such as
fxr).
In MFC, we should leave the existing AUDIT_ARG() macros as they may be
used by third-party kernel modules.
Suggested by: brooks
Approved by: re (kib)
Obtained from: TrustedBSD Project
MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 9fa2a4c..496cecf 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -189,8 +189,8 @@ quotactl(td, uap) int error; struct nameidata nd; - AUDIT_ARG(cmd, uap->cmd); - AUDIT_ARG(uid, uap->uid); + AUDIT_ARG_CMD(uap->cmd); + AUDIT_ARG_UID(uap->uid); if (!prison_allow(td->td_ucred, PR_ALLOW_QUOTAS)) return (EPERM); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, @@ -371,7 +371,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) struct vnode *vp; int error; - AUDIT_ARG(fd, fd); + AUDIT_ARG_FD(fd); error = getvnode(td->td_proc->p_fd, fd, &fp); if (error) return (error); @@ -379,7 +379,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); #ifdef AUDIT - AUDIT_ARG(vnode, vp, ARG_VNODE1); + AUDIT_ARG_VNODE(vp, ARG_VNODE1); #endif mp = vp->v_mount; if (mp) @@ -744,7 +744,7 @@ fchdir(td, uap) int vfslocked; int error; - AUDIT_ARG(fd, uap->fd); + AUDIT_ARG_FD(uap->fd); if ((error = getvnode(fdp, uap->fd, &fp)) != 0) return (error); vp = fp->f_vnode; @@ -752,7 +752,7 @@ fchdir(td, uap) fdrop(fp, td); vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, vp, ARG_VNODE1); + AUDIT_ARG_VNODE(vp, ARG_VNODE1); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { int tvfslocked; @@ -1055,8 +1055,8 @@ kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct nameidata nd; int vfslocked; - AUDIT_ARG(fflags, flags); - AUDIT_ARG(mode, mode); + AUDIT_ARG_FFLAGS(flags); + AUDIT_ARG_MODE(mode); /* XXX: audit dirfd */ /* * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR may @@ -1265,8 +1265,8 @@ kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct nameidata nd; int vfslocked; - AUDIT_ARG(mode, mode); - AUDIT_ARG(dev, dev); + AUDIT_ARG_MODE(mode); + AUDIT_ARG_DEV(dev); switch (mode & S_IFMT) { case S_IFCHR: case S_IFBLK: @@ -1414,7 +1414,7 @@ kern_mkfifoat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct nameidata nd; int vfslocked; - AUDIT_ARG(mode, mode); + AUDIT_ARG_MODE(mode); restart: bwillwrite(); NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, @@ -1677,7 +1677,7 @@ kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, if ((error = copyinstr(path1, syspath, MAXPATHLEN, NULL)) != 0) goto out; } - AUDIT_ARG(text, syspath); + AUDIT_ARG_TEXT(syspath); restart: bwillwrite(); NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, @@ -2689,7 +2689,7 @@ chflags(td, uap) struct nameidata nd; int vfslocked; - AUDIT_ARG(fflags, uap->flags); + AUDIT_ARG_FFLAGS(uap->flags); NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) @@ -2717,7 +2717,7 @@ lchflags(td, uap) struct nameidata nd; int vfslocked; - AUDIT_ARG(fflags, uap->flags); + AUDIT_ARG_FFLAGS(uap->flags); NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) @@ -2751,14 +2751,14 @@ fchflags(td, uap) int vfslocked; int error; - AUDIT_ARG(fd, uap->fd); - AUDIT_ARG(fflags, uap->flags); + AUDIT_ARG_FD(uap->fd); + AUDIT_ARG_FFLAGS(uap->flags); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfflags(td, fp->f_vnode, uap->flags); @@ -2877,7 +2877,7 @@ kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int vfslocked; int follow; - AUDIT_ARG(mode, mode); + AUDIT_ARG_MODE(mode); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, fd, td); @@ -2912,14 +2912,14 @@ fchmod(td, uap) int vfslocked; int error; - AUDIT_ARG(fd, uap->fd); - AUDIT_ARG(mode, uap->mode); + AUDIT_ARG_FD(uap->fd); + AUDIT_ARG_MODE(uap->mode); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfmode(td, fp->f_vnode, uap->mode); @@ -3019,7 +3019,7 @@ kern_fchownat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct nameidata nd; int error, vfslocked, follow; - AUDIT_ARG(owner, uid, gid); + AUDIT_ARG_OWNER(uid, gid); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, fd, td); @@ -3089,14 +3089,14 @@ fchown(td, uap) int vfslocked; int error; - AUDIT_ARG(fd, uap->fd); - AUDIT_ARG(owner, uap->uid, uap->gid); + AUDIT_ARG_FD(uap->fd); + AUDIT_ARG_OWNER(uap->uid, uap->gid); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfown(td, fp->f_vnode, uap->uid, uap->gid); @@ -3324,7 +3324,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, int vfslocked; int error; - AUDIT_ARG(fd, fd); + AUDIT_ARG_FD(fd); if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0) @@ -3332,7 +3332,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); @@ -3478,7 +3478,7 @@ fsync(td, uap) int vfslocked; int error, lock_flags; - AUDIT_ARG(fd, uap->fd); + AUDIT_ARG_FD(uap->fd); if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); vp = fp->f_vnode; @@ -3492,7 +3492,7 @@ fsync(td, uap) lock_flags = LK_EXCLUSIVE; } vn_lock(vp, lock_flags | LK_RETRY); - AUDIT_ARG(vnode, vp, ARG_VNODE1); + AUDIT_ARG_VNODE(vp, ARG_VNODE1); if (vp->v_object != NULL) { VM_OBJECT_LOCK(vp->v_object); vm_object_page_clean(vp->v_object, 0, 0, 0); @@ -3717,7 +3717,7 @@ kern_mkdirat(struct thread *td, int fd, char *path, enum uio_seg segflg, struct nameidata nd; int vfslocked; - AUDIT_ARG(mode, mode); + AUDIT_ARG_MODE(mode); restart: bwillwrite(); NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, @@ -4056,7 +4056,7 @@ kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, long loff; int error, eofflag; - AUDIT_ARG(fd, fd); + AUDIT_ARG_FD(fd); if (count > INT_MAX) return (EINVAL); if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0) @@ -4082,7 +4082,7 @@ unionread: auio.uio_td = td; auio.uio_resid = count; vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG(vnode, vp, ARG_VNODE1); + AUDIT_ARG_VNODE(vp, ARG_VNODE1); loff = auio.uio_offset = fp->f_offset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); |