From 88c04cb7fd357179e7214d264abc89142da04a9d Mon Sep 17 00:00:00 2001 From: Jean-Pierre André Date: Sun, 23 Jun 2013 11:54:12 +0200 Subject: Defended against accessing a non-fuse type file --- kernel/fuse_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) 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)); -- cgit v1.2.3