<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/super.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-12-08T06:16:18Z</updated>
<entry>
<title>ovl: fix d_real() for stacked fs</title>
<updated>2016-12-08T06:16:18Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-11-29T09:20:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=600bec25b855cfa9ae72d17806899bed7e4d5057'/>
<id>urn:sha1:600bec25b855cfa9ae72d17806899bed7e4d5057</id>
<content type='text'>
commit c4fcfc1619ea43a8a89ad2f83ff23905eee088bd upstream.

Handling of recursion in d_real() is completely broken.  Recursion is only
done in the 'inode != NULL' case.  But when opening the file we have
'inode == NULL' hence d_real() will return an overlay dentry.  This won't
work since overlayfs doesn't define its own file operations, so all file
ops will fail.

Fix by doing the recursion first and the check against the inode second.

Bash script to reproduce the issue written by Quentin:

 - 8&lt; - - - - - 8&lt; - - - - - 8&lt; - - - - - 8&lt; - - - -
tmpdir=$(mktemp -d)
pushd ${tmpdir}

mkdir -p {upper,lower,work}
echo -n 'rocks' &gt; lower/ksplice
mount -t overlay level_zero upper -o lowerdir=lower,upperdir=upper,workdir=work
cat upper/ksplice

tmpdir2=$(mktemp -d)
pushd ${tmpdir2}

mkdir -p {upper,work}
mount -t overlay level_one upper -o lowerdir=${tmpdir}/upper,upperdir=upper,workdir=work
ls -l upper/ksplice
cat upper/ksplice
 - 8&lt; - - - - - 8&lt; - - - - - 8&lt; - - - - - 8&lt; - - - -

Reported-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 2d902671ce1c ("vfs: merge .d_select_inode() into .d_real()")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: update S_ISGID when setting posix ACLs</title>
<updated>2016-11-10T15:38:51Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-10-31T13:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ad464dadb7c7abdaf11efe283e2c2679ef55057'/>
<id>urn:sha1:3ad464dadb7c7abdaf11efe283e2c2679ef55057</id>
<content type='text'>
commit fd3220d37b1f6f0cab6142d98b0e6c4082e63299 upstream.

This change fixes xfstest generic/375, which failed to clear the
setgid bit in the following test case on overlayfs:

  touch $testfile
  chown 100:100 $testfile
  chmod 2755 $testfile
  _runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx $testfile

Reported-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Tested-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Fixes: d837a49bd57f ("ovl: fix POSIX ACL setting")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: fix workdir creation</title>
<updated>2016-09-05T11:55:20Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-05T11:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c'/>
<id>urn:sha1:e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c</id>
<content type='text'>
Workdir creation fails in latest kernel.

Fix by allowing EOPNOTSUPP as a valid return value from
vfs_removexattr(XATTR_NAME_POSIX_ACL_*).  Upper filesystem may not support
ACL and still be perfectly able to support overlayfs.

Reported-by: Martin Ziegler &lt;ziegler@uni-freiburg.de&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: c11b9fdd6a61 ("ovl: remove posix_acl_default from workdir")
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: Switch to generic_getxattr</title>
<updated>2016-09-01T09:12:00Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T15:52:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0eb45fc3bb7a2cf9c9c93d9e95986a841e5f4625'/>
<id>urn:sha1:0eb45fc3bb7a2cf9c9c93d9e95986a841e5f4625</id>
<content type='text'>
Now that overlayfs has xattr handlers for iop-&gt;{set,remove}xattr, use
those same handlers for iop-&gt;getxattr as well.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: copyattr after setting POSIX ACL</title>
<updated>2016-09-01T09:12:00Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-01T09:12:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce31513a9114f74fe3e9caa6534d201bdac7238d'/>
<id>urn:sha1:ce31513a9114f74fe3e9caa6534d201bdac7238d</id>
<content type='text'>
Setting POSIX acl may also modify the file mode, so need to copy that up to
the overlay inode.

Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Fixes: d837a49bd57f ("ovl: fix POSIX ACL setting")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: Switch to generic_removexattr</title>
<updated>2016-09-01T09:12:00Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T15:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e585ccc13b3edbb187fb4f1b7cc9397f17d64a9'/>
<id>urn:sha1:0e585ccc13b3edbb187fb4f1b7cc9397f17d64a9</id>
<content type='text'>
Commit d837a49bd57f ("ovl: fix POSIX ACL setting") switches from
iop-&gt;setxattr from ovl_setxattr to generic_setxattr, so switch from
ovl_removexattr to generic_removexattr as well.  As far as permission
checking goes, the same rules should apply in either case.

While doing that, rename ovl_setxattr to ovl_xattr_set to indicate that
this is not an iop-&gt;setxattr implementation and remove the unused inode
argument.

Move ovl_other_xattr_set above ovl_own_xattr_set so that they match the
order of handlers in ovl_xattr_handlers.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Fixes: d837a49bd57f ("ovl: fix POSIX ACL setting")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: Get rid of ovl_xattr_noacl_handlers array</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T14:36:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0c97be22f928b85110504c4bbb8574facb4bd0c0'/>
<id>urn:sha1:0c97be22f928b85110504c4bbb8574facb4bd0c0</id>
<content type='text'>
Use an ordinary #ifdef to conditionally include the POSIX ACL handlers
in ovl_xattr_handlers, like the other filesystems do.  Flag the code
that is now only used conditionally with __maybe_unused.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix spelling mistake: "directries" -&gt; "directories"</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2016-08-18T15:58:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd36570a8805f39b40a0ebde19b08603aa201d17'/>
<id>urn:sha1:fd36570a8805f39b40a0ebde19b08603aa201d17</id>
<content type='text'>
Trivial fix to spelling mistake in pr_err message.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: proper cleanup of workdir</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-01T09:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eea2fb4851e9dcbab6b991aaf47e2e024f1f55a0'/>
<id>urn:sha1:eea2fb4851e9dcbab6b991aaf47e2e024f1f55a0</id>
<content type='text'>
When mounting overlayfs it needs a clean "work" directory under the
supplied workdir.

Previously the mount code removed this directory if it already existed and
created a new one.  If the removal failed (e.g. directory was not empty)
then it fell back to a read-only mount not using the workdir.

While this has never been reported, it is possible to get a non-empty
"work" dir from a previous mount of overlayfs in case of crash in the
middle of an operation using the work directory.

In this case the left over state should be discarded and the overlay
filesystem will be consistent, guaranteed by the atomicity of operations on
moving to/from the workdir to the upper layer.

This patch implements cleaning out any files left in workdir.  It is
implemented using real recursion for simplicity, but the depth is limited
to 2, because the worst case is that of a directory containing whiteouts
under "work".

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: remove posix_acl_default from workdir</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-01T09:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c11b9fdd6a612f376a5e886505f1c54c16d8c380'/>
<id>urn:sha1:c11b9fdd6a612f376a5e886505f1c54c16d8c380</id>
<content type='text'>
Clear out posix acl xattrs on workdir and also reset the mode after
creation so that an inherited sgid bit is cleared.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
</feed>
