<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/super.c, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-11-02T08:54:46Z</updated>
<entry>
<title>ovl: add NULL check in ovl_alloc_inode</title>
<updated>2017-11-02T08:54:46Z</updated>
<author>
<name>Hirofumi Nakagawa</name>
</author>
<published>2017-09-25T18:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d22011059462aa003e5825a8180f12db9a980e0c'/>
<id>urn:sha1:d22011059462aa003e5825a8180f12db9a980e0c</id>
<content type='text'>
commit b3885bd6edb41b91a0e3976469f72ae31bfb8d95 upstream.

This was detected by fault injection test

Signed-off-by: Hirofumi Nakagawa &lt;nklabs@gmail.com&gt;
Fixes: 13cf199d0088 ("ovl: allocate an ovl_inode struct")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: fix regression caused by exclusive upper/work dir protection</title>
<updated>2017-10-12T09:56:16Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-09-29T07:21:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea83a3f315c356ca8baf78a3b79cb2bb88b09939'/>
<id>urn:sha1:ea83a3f315c356ca8baf78a3b79cb2bb88b09939</id>
<content type='text'>
commit 85fdee1eef1a9e48ad5716916677e0c5fbc781e3 upstream.

Enforcing exclusive ownership on upper/work dirs caused a docker
regression: https://github.com/moby/moby/issues/34672.

Euan spotted the regression and pointed to the offending commit.
Vivek has brought the regression to my attention and provided this
reproducer:

Terminal 1:

  mount -t overlay -o workdir=work,lowerdir=lower,upperdir=upper none
        merged/

Terminal 2:

  unshare -m

Terminal 1:

  umount merged
  mount -t overlay -o workdir=work,lowerdir=lower,upperdir=upper none
        merged/
  mount: /root/overlay-testing/merged: none already mounted or mount point
         busy

To fix the regression, I replaced the error with an alarming warning.
With index feature enabled, mount does fail, but logs a suggestion to
override exclusive dir protection by disabling index.
Note that index=off mount does take the inuse locks, so a concurrent
index=off will issue the warning and a concurrent index=on mount will fail.

Documentation was updated to reflect this change.

Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs")
Reported-by: Euan Kemp &lt;euank@euank.com&gt;
Reported-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: fix xattr get and set with selinux</title>
<updated>2017-07-20T09:08:21Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2017-07-20T09:08:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d88f183734c0d916428911df006e645a6162cab'/>
<id>urn:sha1:1d88f183734c0d916428911df006e645a6162cab</id>
<content type='text'>
inode_doinit_with_dentry() in SELinux wants to read the upper inode's xattr
to get security label, and ovl_xattr_get() calls ovl_dentry_real(), which
depends on dentry-&gt;d_inode, but d_inode is null and not initialized yet at
this point resulting in an Oops.

Fix by getting the upperdentry info from the inode directly in this case.

Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Fixes: 09d8b586731b ("ovl: move __upperdentry to ovl_inode")
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: remove unneeded check for IS_ERR()</title>
<updated>2017-07-13T20:06:46Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-07-11T12:58:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a59f97ff66f0058702ed6f6e26dd8fa3c34caf62'/>
<id>urn:sha1:a59f97ff66f0058702ed6f6e26dd8fa3c34caf62</id>
<content type='text'>
ovl_workdir_create() returns a valid index dentry or NULL.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix random return value on mount</title>
<updated>2017-07-13T20:06:45Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-07-11T12:58:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fc646b44385ff0a9853f6590497e43049eeb311'/>
<id>urn:sha1:8fc646b44385ff0a9853f6590497e43049eeb311</id>
<content type='text'>
On failure to prepare_creds(), mount fails with a random
return value, as err was last set to an integer cast of
a valid lower mnt pointer or set to 0 if inodes index feature
is enabled.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: 3fe6e52f0626 ("ovl: override creds with the ones from ...")
Cc: &lt;stable@vger.kernel.org&gt; # v4.7
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: cleanup orphan index entries</title>
<updated>2017-07-04T20:03:19Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-06-21T10:46:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=caf70cb2ba5dff85ea90f494a30075af92df13b0'/>
<id>urn:sha1:caf70cb2ba5dff85ea90f494a30075af92df13b0</id>
<content type='text'>
index entry should live only as long as there are upper or lower
hardlinks.

Cleanup orphan index entries on mount and when dropping the last
overlay inode nlink.

When about to cleanup or link up to orphan index and the index inode
nlink &gt; 1, admit that something went wrong and adjust overlay nlink
to index inode nlink - 1 to prevent it from dropping below zero.
This could happen when adding lower hardlinks underneath a mounted
overlay and then trying to unlink them.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: add flag for upper in ovl_entry</title>
<updated>2017-07-04T20:03:18Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2017-07-04T20:03:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55acc6618259c8ff0a400a131f0f4b613e96010a'/>
<id>urn:sha1:55acc6618259c8ff0a400a131f0f4b613e96010a</id>
<content type='text'>
For rename, we need to ensure that an upper alias exists for hard links
before attempting the operation.  Introduce a flag in ovl_entry to track
the state of the upper alias.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: cleanup bad and stale index entries on mount</title>
<updated>2017-07-04T20:03:17Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-06-21T12:28:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=415543d5c64fe490b4b6a7e21c3ea2f1310c442f'/>
<id>urn:sha1:415543d5c64fe490b4b6a7e21c3ea2f1310c442f</id>
<content type='text'>
Bad index entries are entries whose name does not match the
origin file handle stored in trusted.overlay.origin xattr.
Bad index entries could be a result of a system power off in
the middle of copy up.

Stale index entries are entries whose origin file handle is
stale. Stale index entries could be a result of copying layers
or removing lower entries while the overlay is not mounted.
The case of copying layers should be detected earlier by the
verification of upper root dir origin and index dir origin.

Both bad and stale index entries are detected and removed
on mount.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: verify index dir matches upper dir</title>
<updated>2017-07-04T20:03:17Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-06-21T12:28:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54fb347e836faadaed2a5617fb4dd4a4597d0490'/>
<id>urn:sha1:54fb347e836faadaed2a5617fb4dd4a4597d0490</id>
<content type='text'>
An index dir contains persistent hardlinks to files in upper dir.
Therefore, we must never mount an existing index dir with a differnt
upper dir.

Store the upper root dir file handle in index dir inode when index
dir is created and verify the file handle before using an existing
index dir on mount.

Add an 'is_upper' flag to the overlay file handle encoding and set it
when encoding the upper root file handle. This is not critical for index
dir verification, but it is good practice towards a standard overlayfs
file handle format for NFS export.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: verify upper root dir matches lower root dir</title>
<updated>2017-07-04T20:03:17Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2017-06-21T12:28:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b88a2e6403638b56556ed5b1c60d9318eefea9c'/>
<id>urn:sha1:8b88a2e6403638b56556ed5b1c60d9318eefea9c</id>
<content type='text'>
When inodes index feature is enabled, verify that the file handle stored
in upper root dir matches the lower root dir or fail to mount.

If upper root dir has no stored file handle, encode and store the lower
root dir file handle in overlay.origin xattr.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
