Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
#include <security/audit/audit.h> | #include <security/audit/audit.h> | ||||
#include <security/mac/mac_framework.h> | #include <security/mac/mac_framework.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <fs/devfs/devfs.h> | |||||
#include <ufs/ufs/quota.h> | #include <ufs/ufs/quota.h> | ||||
MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); | MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); | ||||
SDT_PROVIDER_DEFINE(vfs); | SDT_PROVIDER_DEFINE(vfs); | ||||
SDT_PROBE_DEFINE2(vfs, , stat, mode, "char *", "int"); | SDT_PROBE_DEFINE2(vfs, , stat, mode, "char *", "int"); | ||||
SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); | SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); | ||||
▲ Show 20 Lines • Show All 4,117 Lines • ▼ Show 20 Lines | #endif | ||||
error = VOP_GETATTR(vp, &vattr, td->td_ucred); | error = VOP_GETATTR(vp, &vattr, td->td_ucred); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
if (td->td_ucred->cr_uid != vattr.va_uid) { | if (td->td_ucred->cr_uid != vattr.va_uid) { | ||||
error = priv_check(td, PRIV_VFS_ADMIN); | error = priv_check(td, PRIV_VFS_ADMIN); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
} | } | ||||
if (vp->v_usecount > 1 || vcount(vp) > 1) | if (devfs_usecount(vp) > 0) | ||||
mjg: this should be > 0 | |||||
VOP_REVOKE(vp, REVOKEALL); | VOP_REVOKE(vp, REVOKEALL); | ||||
out: | out: | ||||
vput(vp); | vput(vp); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Convert a user file descriptor to a kernel file entry and check that, if it | * Convert a user file descriptor to a kernel file entry and check that, if it | ||||
▲ Show 20 Lines • Show All 684 Lines • Show Last 20 Lines |
this should be > 0