<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/inode.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-11-10T15:38:51Z</updated>
<entry>
<title>ovl: fix get_acl() on tmpfs</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=be9015460ed58cd5ec2f944e29d09cdf32f0345c'/>
<id>urn:sha1:be9015460ed58cd5ec2f944e29d09cdf32f0345c</id>
<content type='text'>
commit b93d4a0eb308d4400b84c8b24c1b80e09a9497d0 upstream.

tmpfs doesn't have -&gt;get_acl() because it only uses cached acls.

This fixes the acl tests in pjdfstest when tmpfs is used as the upper layer
of the overlay.

Reported-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 39a25b2b3762 ("ovl: define -&gt;get_acl() for overlay inodes")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: listxattr: use strnlen()</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=7cb35119d067191ce9ebc380a599db0b03cbd9d9'/>
<id>urn:sha1:7cb35119d067191ce9ebc380a599db0b03cbd9d9</id>
<content type='text'>
Be defensive about what underlying fs provides us in the returned xattr
list buffer.  If it's not properly null terminated, bail out with a warning
insead of BUG.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
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: 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: Fix OVL_XATTR_PREFIX</title>
<updated>2016-09-01T09:11:59Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-08-22T15:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe2b75952347762a21f67d9df1199137ae5988b2'/>
<id>urn:sha1:fe2b75952347762a21f67d9df1199137ae5988b2</id>
<content type='text'>
Make sure ovl_own_xattr_handler only matches attribute names starting
with "overlay.", not "overlayXXX".

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: don't cache acl on overlay layer</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=2a3a2a3f35249412e35fbb48b743348c40373409'/>
<id>urn:sha1:2a3a2a3f35249412e35fbb48b743348c40373409</id>
<content type='text'>
Some operations (setxattr/chmod) can make the cached acl stale.  We either
need to clear overlay's acl cache for the affected inode or prevent acl
caching on the overlay altogether.  Preventing caching has the following
advantages:

 - no double caching, less memory used

 - overlay cache doesn't go stale when fs clears it's own cache

Possible disadvantage is performance loss.  If that becomes a problem
get_acl() can be optimized for overlayfs.

This patch disables caching by pre setting i_*acl to a value that

  - has bit 0 set, so is_uncached_acl() will return true

  - is not equal to ACL_NOT_CACHED, so get_acl() will not overwrite it

The constant -3 was chosen for this purpose.

Fixes: 39a25b2b3762 ("ovl: define -&gt;get_acl() for overlay inodes")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: use cached acl on underlying layer</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=5201dc449e4b6b6d7e92f7f974269b11681f98b5'/>
<id>urn:sha1:5201dc449e4b6b6d7e92f7f974269b11681f98b5</id>
<content type='text'>
Instead of calling -&gt;get_acl() directly, use get_acl() to get the cached
value.

We will have the acl cached on the underlying inode anyway, because we do
permission checking on the both the overlay and the underlying fs.

So, since we already have double caching, this improves performance without
any cost.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: don't copy up opaqueness</title>
<updated>2016-08-08T13:08:49Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-08-08T13:08:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0956254a2d5b9e2141385514553aeef694dfe3b5'/>
<id>urn:sha1:0956254a2d5b9e2141385514553aeef694dfe3b5</id>
<content type='text'>
When a copy up of a directory occurs which has the opaque xattr set, the
xattr remains in the upper directory. The immediate behavior with overlayfs
is that the upper directory is not treated as opaque, however after a
remount the opaque flag is used and upper directory is treated as opaque.
This causes files created in the lower layer to be hidden when using
multiple lower directories.

Fix by not copying up the opaque flag.

To reproduce:

 ----8&lt;---------8&lt;---------8&lt;---------8&lt;---------8&lt;---------8&lt;----
mkdir -p l/d/s u v w mnt
mount -t overlay overlay -olowerdir=l,upperdir=u,workdir=w mnt
rm -rf mnt/d/
mkdir -p mnt/d/n
umount mnt
mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
touch mnt/d/foo
umount mnt
mount -t overlay overlay -olowerdir=u:l,upperdir=v,workdir=w mnt
ls mnt/d
 ----8&lt;---------8&lt;---------8&lt;---------8&lt;---------8&lt;---------8&lt;----
 
output should be:  "foo  n"

Reported-by: Derek McGowan &lt;dmcg@drizz.net&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=151291
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: append MAY_READ when diluting write checks</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Vivek Goyal</name>
</author>
<published>2016-07-13T15:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=500cac3ccee65526d5075da3af2674101305bf8c'/>
<id>urn:sha1:500cac3ccee65526d5075da3af2674101305bf8c</id>
<content type='text'>
Right now we remove MAY_WRITE/MAY_APPEND bits from mask if realfile is on
lower/. This is done as files on lower will never be written and will be
copied up. But to copy up a file, mounter should have MAY_READ permission
otherwise copy up will fail. So set MAY_READ in mask when MAY_WRITE is
reset.

Dan Walsh noticed this when he did access(lowerfile, W_OK) and it returned
True (context mounts) but when he tried to actually write to file, it
failed as mounter did not have permission on lower file.

[SzM] don't set MAY_READ if only MAY_APPEND is set without MAY_WRITE; this
won't trigger a copy-up.

Reported-by: Dan Walsh &lt;dwalsh@redhat.com&gt;
Signed-off-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: dilute permission checks on lower only if not special file</title>
<updated>2016-07-29T10:05:24Z</updated>
<author>
<name>Vivek Goyal</name>
</author>
<published>2016-07-13T15:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e29841a0ab3d03e77313abd8fb4c16e80fb26e29'/>
<id>urn:sha1:e29841a0ab3d03e77313abd8fb4c16e80fb26e29</id>
<content type='text'>
Right now if file is on lower/, we remove MAY_WRITE/MAY_APPEND bits from
mask as lower/ will never be written and file will be copied up. But this
is not true for special files. These files are not copied up and are opened
in place. So don't dilute the checks for these types of files.

Reported-by: Dan Walsh &lt;dwalsh@redhat.com&gt;
Signed-off-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
