"J. R. Okajima":
> Unfortunately this Call Trace looks unreliable, and I cannot see the
> behaviour exactly.  But I can assume that there is a call chain such
> like this.
> - "ls" issues lgetxattr(2)
>   + SyS_lgetxattr()
>     + aufs_getxattr()
>       + au_lgxattr()
>         + si_read_lock()

It might be this.
- "ls" issues lgetxattr(2)
  + SyS_lgetxattr()
    + vfs: lookup
      + aufs: lookup
        + vfs: d_splice_alias
          + selinux: d_instantiate
            + vfs: getxattr
              + aufs: getxattr
                --> BANG!! coz d_inode is unset

In other words,
- aufs calls vfs:d_splice_alias() which sets d_inode.
- vfs:d_splice_alias() calls selinux's hook selinux_d_instantiate()
  BEFORE setting d_inode.
- selinux wants xattr and it reaches aufs_getxattr() which expects
  d_inode is set.
- aufs gets unset d_inode and crash.

I have a patch to fix this problem, but it is for aufs4.19 which is my
current development base version.  Now I am testing.
It won't be applied cleanly to aufs3.16.  Jon, if you want the patch and
will fix manually for your version, I will post here.


J. R. Okajima

Reply via email to