<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-10T15:39:20Z</updated>
<entry>
<title>ovl: fix open in stacked overlay</title>
<updated>2018-11-10T15:39:20Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2015-10-12T13:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d255d18a34a8d53ccc4a019dc07e17b6e8cf6bd1'/>
<id>urn:sha1:d255d18a34a8d53ccc4a019dc07e17b6e8cf6bd1</id>
<content type='text'>
[ Upstream commit 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 ]

If two overlayfs filesystems are stacked on top of each other, then we need
recursion in ovl_d_select_inode().

I guess d_backing_inode() is supposed to do that.  But currently it doesn't
and that functionality is open coded in vfs_open().  This is now copied
into ovl_d_select_inode() to fix this regression.

Reported-by: Alban Crequy &lt;alban.crequy@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v4.2+
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: filter trusted xattr for non-admin</title>
<updated>2018-04-13T17:52:16Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2017-05-29T13:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4bcc9b4b3a0a0fcf269558db8bc54cc9586f585f'/>
<id>urn:sha1:4bcc9b4b3a0a0fcf269558db8bc54cc9586f585f</id>
<content type='text'>
[ Upstream commit a082c6f680da298cf075886ff032f32ccb7c5e1a ]

Filesystems filter out extended attributes in the "trusted." domain for
unprivlieged callers.

Overlay calls underlying filesystem's method with elevated privs, so need
to do the filtering in overlayfs too.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ovl: fsync after copy-up</title>
<updated>2016-11-24T04:09:18Z</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=dff2cd539e4b537bf2e929eea256b20cd5262b35'/>
<id>urn:sha1:dff2cd539e4b537bf2e929eea256b20cd5262b35</id>
<content type='text'>
[ Upstream commit 641089c1549d8d3df0b047b5de7e9a111362cdce ]

Make sure the copied up file hits the disk before renaming to the final
destination.  If this is not done then the copy-up may corrupt the data in
the file in case of a crash.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix workdir creation</title>
<updated>2016-09-22T17:25:10Z</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=2ee6abbd821cd0374a1a8217651308a0486b5125'/>
<id>urn:sha1:2ee6abbd821cd0374a1a8217651308a0486b5125</id>
<content type='text'>
[ Upstream commit e1ff3dd1ae52cef5b5373c8cc4ad949c2c25a71c ]

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;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: listxattr: use strnlen()</title>
<updated>2016-09-15T22:54:06Z</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=f45724343a4a5399386f8df3e548445fc9056c48'/>
<id>urn:sha1:f45724343a4a5399386f8df3e548445fc9056c48</id>
<content type='text'>
[ Upstream commit 7cb35119d067191ce9ebc380a599db0b03cbd9d9 ]

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;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: remove posix_acl_default from workdir</title>
<updated>2016-09-15T22:54:06Z</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=cc318bc6819922ad17dbcbb5e0ac5164bcbb60d2'/>
<id>urn:sha1:cc318bc6819922ad17dbcbb5e0ac5164bcbb60d2</id>
<content type='text'>
[ Upstream commit c11b9fdd6a612f376a5e886505f1c54c16d8c380 ]

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;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: don't copy up opaqueness</title>
<updated>2016-09-12T18:53:02Z</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=5edbe377024b8f702463e1cf6bb32048e9bce8d8'/>
<id>urn:sha1:5edbe377024b8f702463e1cf6bb32048e9bce8d8</id>
<content type='text'>
[ Upstream commit 0956254a2d5b9e2141385514553aeef694dfe3b5 ]

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;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: verify upper dentry in ovl_remove_and_whiteout()</title>
<updated>2016-08-08T01:59:02Z</updated>
<author>
<name>Maxim Patlasov</name>
</author>
<published>2016-07-22T01:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5eaee47bcdf4f17e2bdd6105f12b6d5e567e72c4'/>
<id>urn:sha1:5eaee47bcdf4f17e2bdd6105f12b6d5e567e72c4</id>
<content type='text'>
[ Upstream commit cfc9fde0b07c3b44b570057c5f93dda59dca1c94 ]

The upper dentry may become stale before we call ovl_lock_rename_workdir.
For example, someone could (mistakenly or maliciously) manually unlink(2)
it directly from upperdir.

To ensure it is not stale, let's lookup it after ovl_lock_rename_workdir
and and check if it matches the upper dentry.

Essentially, it is the same problem and similar solution as in
commit 11f3710417d0 ("ovl: verify upper dentry before unlink and rename").

Signed-off-by: Maxim Patlasov &lt;mpatlasov@virtuozzo.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: Copy up underlying inode's -&gt;i_mode to overlay inode</title>
<updated>2016-08-08T01:44:56Z</updated>
<author>
<name>Vivek Goyal</name>
</author>
<published>2016-07-01T20:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a3638d4fdf49046a09a71d9ce8c426bbfd37fbbc'/>
<id>urn:sha1:a3638d4fdf49046a09a71d9ce8c426bbfd37fbbc</id>
<content type='text'>
[ Upstream commit 07a2daab49c549a37b5b744cbebb6e3f445f12bc ]

Right now when a new overlay inode is created, we initialize overlay
inode's -&gt;i_mode from underlying inode -&gt;i_mode but we retain only
file type bits (S_IFMT) and discard permission bits.

This patch changes it and retains permission bits too. This should allow
overlay to do permission checks on overlay inode itself in task context.

[SzM] It also fixes clearing suid/sgid bits on write.

Signed-off-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>ovl: handle ATTR_KILL*</title>
<updated>2016-08-08T01:44:50Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-07-04T14:49:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4e1ac55843e799890318798794d7e6b48a68d4c'/>
<id>urn:sha1:d4e1ac55843e799890318798794d7e6b48a68d4c</id>
<content type='text'>
[ Upstream commit b99c2d913810e56682a538c9f2394d76fca808f8 ]

Before 4bacc9c9234c ("overlayfs: Make f_path...") file-&gt;f_path pointed to
the underlying file, hence suid/sgid removal on write worked fine.

After that patch file-&gt;f_path pointed to the overlay file, and the file
mode bits weren't copied to overlay_inode-&gt;i_mode.  So the suid/sgid
removal simply stopped working.

The fix is to copy the mode bits, but then ovl_setattr() needs to clear
ATTR_MODE to avoid the BUG() in notify_change().  So do this first, then in
the next patch copy the mode.

Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
</feed>
