An unofficial, read-only Hacker News reader.

Nfs2root: A 12-year-old pre-auth remote root in the Linux kernel's NFS server (opens external site)

216 points by dm 4 days ago | opensec.in | 95 comments on HN

View full thread · View on Hacker News

Comment thread (3)

  1. There are userspace nfsd implementations, Ganesha is probably the most fully-featured one these days and it works on several *nix systems.

    File handles (unique identifiers for inodes that can be used to reopen a file later) have been exposed to userspace for a long time with name_to_handle_at(2) and open_by_handle_at(2) -- these were originally exposed precisely for userspace nfsd.

    The topic of i_version semantics has been discussed recently[1,2]. The kernel's nfsd lies about filesystems that don't support i_version so it's not a hard requirement for a replacement, and as the articles I linked note you can retrieve i_generation via ioctl(FS_IOC_GETVERSION).

    And it's important to note that most (if not all) of these are related to optimisations.

    [1]: https://lwn.net/Articles/905931/ [2]: https://lwn.net/Articles/937247/

    Replies (2)
    1.   > Ganesha is probably the most fully-featured one these days and it works on
        > several *nix systems.
      
      Yes, including MacOS as a result of my contributions :)

      I was using Ganesha at work because FUSE on macOS had been deprecated, and we were trying to serve the filesystem locally via NFS. We emulated filehandles with an LRU cache.

    2. I know ganesha and tried to use it. However it is not straightforward to setup, in particular on a container, at least not with the little patience I had when I did it. In the end I used sshfs which was enough for my use case.