<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/dir.c, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-21T08:22:00Z</updated>
<entry>
<title>ovl: fix recursive oi-&gt;lock in ovl_link()</title>
<updated>2018-11-21T08:22:00Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-10-18T06:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa67028ac42275edd65ed32c798b50249e11012f'/>
<id>urn:sha1:aa67028ac42275edd65ed32c798b50249e11012f</id>
<content type='text'>
commit 6cd078702f2f33cb6b19a682de3e9184112f1a46 upstream.

linking a non-copied-up file into a non-copied-up parent results in a
nested call to mutex_lock_interruptible(&amp;oi-&gt;lock). Fix this by copying up
target parent before ovl_nlink_start(), same as done in ovl_rename().

~/unionmount-testsuite$ ./run --ov -s
~/unionmount-testsuite$ ln /mnt/a/foo100 /mnt/a/dir100/

 WARNING: possible recursive locking detected
 --------------------------------------------
 ln/1545 is trying to acquire lock:
 00000000bcce7c4c (&amp;ovl_i_lock_key[depth]){+.+.}, at:
     ovl_copy_up_start+0x28/0x7d
 but task is already holding lock:
 0000000026d73d5b (&amp;ovl_i_lock_key[depth]){+.+.}, at:
     ovl_nlink_start+0x3c/0xc1

[SzM: this seems to be a false positive, but doing the copy-up first is
harmless and removes the lockdep splat]

Reported-by: syzbot+3ef5c0d1a5cb0b21e6be@syzkaller.appspotmail.com
Fixes: 5f8415d6b87e ("ovl: persistent overlay inode nlink for...")
Cc: &lt;stable@vger.kernel.org&gt; # v4.13
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
[amir: backport to v4.18]
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: check whiteout in ovl_create_over_whiteout()</title>
<updated>2018-11-21T08:21:59Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-10-31T11:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fcbb25da516421694c80404a496dec2b2ec914b'/>
<id>urn:sha1:6fcbb25da516421694c80404a496dec2b2ec914b</id>
<content type='text'>
commit 5e1275808630ea3b2c97c776f40e475017535f72 upstream.

Kaixuxia repors that it's possible to crash overlayfs by removing the
whiteout on the upper layer before creating a directory over it.  This is a
reproducer:

 mkdir lower upper work merge
 touch lower/file
 mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merge
 rm merge/file
 ls -al merge/file
 rm upper/file
 ls -al merge/
 mkdir merge/file

Before commencing with a vfs_rename(..., RENAME_EXCHANGE) verify that the
lookup of "upper" is positive and is a whiteout, and return ESTALE
otherwise.

Reported by: kaixuxia &lt;xiakaixu1987@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: e9be9d5e76e3 ("overlay filesystem")
Cc: &lt;stable@vger.kernel.org&gt; # v3.18
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: set I_CREATING on inode being created</title>
<updated>2018-10-10T06:56:04Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-08-22T08:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6aa74c2ad61278ebd419b36aecb7806070d1555'/>
<id>urn:sha1:a6aa74c2ad61278ebd419b36aecb7806070d1555</id>
<content type='text'>
commit 6faf05c2b2b4fe70d9068067437649401531de0a upstream.

...otherwise there will be list corruption due to inode_sb_list_add() being
called for inode already on the sb list.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: e950564b97fd ("vfs: don't evict uninitialized inode")
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
To: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ovl: use inode_insert5() to hash a newly created inode</title>
<updated>2018-05-31T09:06:12Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-05-11T08:15:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=01b39dcc95680b04c7af5de7f39f577e9c4865e3'/>
<id>urn:sha1:01b39dcc95680b04c7af5de7f39f577e9c4865e3</id>
<content type='text'>
Currently, there is a small window where ovl_obtain_alias() can
race with ovl_instantiate() and create two different overlay inodes
with the same underlying real non-dir non-hardlink inode.

The race requires an adversary to guess the file handle of the
yet to be created upper inode and decode the guessed file handle
after ovl_creat_real(), but before ovl_instantiate().
This race does not affect overlay directory inodes, because those
are decoded via ovl_lookup_real() and not with ovl_obtain_alias().

This patch fixes the race, by using inode_insert5() to add a newly
created inode to cache.

If the newly created inode apears to already exist in cache (hashed
by the same real upper inode), we instantiate the dentry with the old
inode and drop the new inode, instead of silently not hashing the new
inode.

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: return EIO on internal error</title>
<updated>2018-05-31T09:06:11Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-05-31T09:06:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd8ac699ed6e1ef296da8cb9d12d36428b901871'/>
<id>urn:sha1:dd8ac699ed6e1ef296da8cb9d12d36428b901871</id>
<content type='text'>
EIO better represents an internal error than ENOENT.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: make ovl_create_real() cope with vfs_mkdir() safely</title>
<updated>2018-05-31T09:06:11Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2018-05-16T15:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f73cc77c3afffc9a90fad972fe34af52cdb72979'/>
<id>urn:sha1:f73cc77c3afffc9a90fad972fe34af52cdb72979</id>
<content type='text'>
vfs_mkdir() may succeed and leave the dentry passed to it unhashed and
negative.  ovl_create_real() is the last caller breaking when that
happens.

[amir: split re-factoring of ovl_create_temp() to prep patch
       add comment about unhashed dir after mkdir
       add pr_warn() if mkdir succeeds and lookup fails]

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&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: create helper ovl_create_temp()</title>
<updated>2018-05-31T09:06:11Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-05-16T14:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=137ec526a20c4e4d21d658a6581b471d39860911'/>
<id>urn:sha1:137ec526a20c4e4d21d658a6581b471d39860911</id>
<content type='text'>
Also used ovl_create_temp() in ovl_create_index() instead of calling
ovl_do_mkdir() directly, so now all callers of ovl_do_mkdir() are routed
through ovl_create_real(), which paves the way for Al's fix for non-hashed
result from vfs_mkdir().

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: return dentry from ovl_create_real()</title>
<updated>2018-05-31T09:06:11Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2018-05-16T14:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0'/>
<id>urn:sha1:95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0</id>
<content type='text'>
Al Viro suggested to simplify callers of ovl_create_real() by
returning the created dentry (or ERR_PTR) from ovl_create_real().

Suggested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: struct cattr cleanups</title>
<updated>2018-05-31T09:06:10Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-05-16T14:35:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=471ec5dcf4e712ea81bf431a57c98d4b67416d30'/>
<id>urn:sha1:471ec5dcf4e712ea81bf431a57c98d4b67416d30</id>
<content type='text'>
* Rename to ovl_cattr

* Fold ovl_create_real() hardlink argument into struct ovl_cattr

* Create macro OVL_CATTR() to initialize struct ovl_cattr from mode

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: strip debug argument from ovl_do_ helpers</title>
<updated>2018-05-31T09:06:10Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2018-05-16T14:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6cf00764b0082cefdaf5a36202aceb1ab2470051'/>
<id>urn:sha1:6cf00764b0082cefdaf5a36202aceb1ab2470051</id>
<content type='text'>
It did not prove to be useful.

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