[Bug 257187] NFSv3 server creates symlinks that local clients can't read [ZFS]

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 14 Jul 2021 16:20:16 UTC

            Bug ID: 257187
           Summary: NFSv3 server creates symlinks that local clients can't
                    read [ZFS]
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: wollman@FreeBSD.org

Our backup vendor alerted us to this issue.  Most of our NFS clients are Ubuntu
systems, and use NFSv3.  Somehow, one of our users managed to create a bunch of
symbolic links for which lstat(2) succeeds, but readlink(2) fails with
[ENOENT].  The links work just fine on the Linux clients over NFS.

Example ktrace on the server side:

  7597 readlink CALL 
  7597 readlink NAMI 
  7597 readlink STRU  struct stat {dev=16608010843616580276, ino=14916386,
mode=0120777, nlink=1, uid=23398, gid=21158, rdev=18446744073709551615,
atime=1619701157.648845720, mtime=1619701157.648845720,
ctime=1619701157.648845720, birthtime=1619701157.648845720, size=298,
blksize=4096, blocks=1, flags=0x800 }
  7597 readlink RET   fstatat 0
  7597 readlink CALL  readlink(0x7fffffffed99,0x7fffffffdff4,0x3ff)
  7597 readlink NAMI 
  7597 readlink RET   readlink -1 errno 2 No such file or directory

Results of Linux stat(1) utility on the client side:

$ stat
  Size: 298             Blocks: 27         IO Block: 131072 symbolic link
Device: 36h/54d Inode: 14916386    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (23398/ victory)   Gid: (21158/sanchez-grp)
Access: 2021-07-14 12:06:14.024176419 -0400
Modify: 2021-04-29 08:59:17.648845720 -0400
Change: 2021-04-29 08:59:17.648845720 -0400
 Birth: -

This seems like a bug in either the ZPL or the NFS server.  I can't even see
how local lstat() and NFSPROC_READLINK could succeed and local readlink() still

You are receiving this mail because:
You are the assignee for the bug.