Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in fuse_nfs_readdir due to permission denied on NFS server #32

Open
crossmeta opened this issue Apr 8, 2019 · 0 comments
Open

Comments

@crossmeta
Copy link

I am trying to port this fuse-nfs to Crossmeta FUSE on Windows https://github.com/crossmeta/cxfuse and amazingly in less than a hour, I could have the program running.
While testing I encountered this problem with fuse_nfs_readdir() when it tried to read directory with no permission and it received NFS error 13. But in the code I do not see check for status and instead start filling the directory entries and accessed NULL nfsdir pointer.

diff --git a/fuse/fuse-nfs.c b/fuse/fuse-nfs.c
index 0bddb30..fa4ef90 100755
--- a/fuse/fuse-nfs.c
+++ b/fuse/fuse-nfs.c
@@ -303,6 +303,8 @@ fuse_nfs_readdir(const char *path, void *buf, fuse_fill_dir_
                return ret;
        }
        wait_for_nfs_reply(nfs, &cb_data);
+       if (cb_data.status)
+               return cb_data.status;
 
        nfsdir = cb_data.return_data;
        while ((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {
satmandu added a commit to satmandu/fuse-nfs that referenced this issue Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant