diff options
author | Jean-Pierre André <jpandre@users.sourceforge.net> | 2013-06-23 11:54:12 +0200 |
---|---|---|
committer | Jean-Pierre André <jpandre@users.sourceforge.net> | 2013-06-23 11:54:12 +0200 |
commit | 88c04cb7fd357179e7214d264abc89142da04a9d (patch) | |
tree | 30d8cd25f0f18685e4e1f50d1528306ec098f51d | |
parent | d1d9e7105b213544a23595dba7a4e2d5594a9a3b (diff) | |
download | illumos-fusefs-88c04cb7fd357179e7214d264abc89142da04a9d.tar.gz |
Defended against accessing a non-fuse type file
-rw-r--r-- | kernel/fuse_vnops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c index 4c4d33b..402b5b5 100644 --- a/kernel/fuse_vnops.c +++ b/kernel/fuse_vnops.c @@ -1278,6 +1278,8 @@ wrfuse(struct vnode *vp, struct uio *uiop, int ioflag, mutex_exit(&p->p_lock); return (EFBIG); } + if (!vdata) + return (EIO); if ((err = fuse_getfilesize(vp, &fsize, credp))) { DTRACE_PROBE3(wrfuse_err_filesize, char *, "fuse_getfilesize failed", @@ -1947,6 +1949,8 @@ fuse_access_i(void *vvp, int mode, struct cred *credp) if (vp->v_type == VREG && mode == VEXEC) { return (fuse_access_inkernelcheck(vp, mode, credp)); } else { + if (!vp->v_data) + return (EIO); msgp = fuse_setup_message(sizeof (*fai), FUSE_ACCESS, VNODE_TO_NODEID(vp), credp, FUSE_GET_UNIQUE(sep)); |