<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/super.c, branch linux-5.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-15T22:11:15Z</updated>
<entry>
<title>ovl: fix mount option checks for nfs_export with no upperdir</title>
<updated>2020-07-15T22:11:15Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2020-07-13T14:19:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0e1266ed24b8a69655e1ab7fb618dbf6730879b'/>
<id>urn:sha1:f0e1266ed24b8a69655e1ab7fb618dbf6730879b</id>
<content type='text'>
Without upperdir mount option, there is no index dir and the dependency
checks nfs_export =&gt; index for mount options parsing are incorrect.

Allow the combination nfs_export=on,index=off with no upperdir and move
the check for dependency redirect_dir=nofollow for non-upper mount case
to mount options parsing.

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: force read-only sb on failure to create index dir</title>
<updated>2020-07-15T22:11:15Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2020-07-13T14:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=470c15636125d1591bc901f6aa2d8e4a60ed2190'/>
<id>urn:sha1:470c15636125d1591bc901f6aa2d8e4a60ed2190</id>
<content type='text'>
With index feature enabled, on failure to create index dir, overlay is
being mounted read-only.  However, we do not forbid user to remount overlay
read-write.  Fix that by setting ofs-&gt;workdir to NULL, which prevents
remount read-write.

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 regression with re-formatted lower squashfs</title>
<updated>2020-07-15T22:10:31Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2020-07-08T13:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a888db310195400f050b89c47673f0f8babfbb41'/>
<id>urn:sha1:a888db310195400f050b89c47673f0f8babfbb41</id>
<content type='text'>
Commit 9df085f3c9a2 ("ovl: relax requirement for non null uuid of lower
fs") relaxed the requirement for non null uuid with single lower layer to
allow enabling index and nfs_export features with single lower squashfs.

Fabian reported a regression in a setup when overlay re-uses an existing
upper layer and re-formats the lower squashfs image.  Because squashfs
has no uuid, the origin xattr in upper layer are decoded from the new
lower layer where they may resolve to a wrong origin file and user may
get an ESTALE or EIO error on lookup.

To avoid the reported regression while still allowing the new features
with single lower squashfs, do not allow decoding origin with lower null
uuid unless user opted-in to one of the new features that require
following the lower inode of non-dir upper (index, xino, metacopy).

Reported-by: Fabian &lt;godi.beat@gmx.net&gt;
Link: https://lore.kernel.org/linux-unionfs/32532923.JtPX5UtSzP@fgdesktop/
Fixes: 9df085f3c9a2 ("ovl: relax requirement for non null uuid of lower fs")
Cc: stable@vger.kernel.org # v4.20+
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 oops in ovl_indexdir_cleanup() with nfs_export=on</title>
<updated>2020-07-15T22:09:59Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2020-06-21T06:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20396365a16dae4b4e3967fc7115d5336feb30ee'/>
<id>urn:sha1:20396365a16dae4b4e3967fc7115d5336feb30ee</id>
<content type='text'>
Mounting with nfs_export=on, xfstests overlay/031 triggers a kernel panic
since v5.8-rc1 overlayfs updates.

 overlayfs: orphan index entry (index/00fb1..., ftype=4000, nlink=2)
 BUG: kernel NULL pointer dereference, address: 0000000000000030
 RIP: 0010:ovl_cleanup_and_whiteout+0x28/0x220 [overlay]

Bisect point at commit c21c839b8448 ("ovl: whiteout inode sharing")

Minimal reproducer:
--------------------------------------------------
rm -rf l u w m
mkdir -p l u w m
mkdir -p l/testdir
touch l/testdir/testfile
mount -t overlay -o lowerdir=l,upperdir=u,workdir=w,nfs_export=on overlay m
echo 1 &gt; m/testdir/testfile
umount m
rm -rf u/testdir
mount -t overlay -o lowerdir=l,upperdir=u,workdir=w,nfs_export=on overlay m
umount m
--------------------------------------------------

When mount with nfs_export=on, and fail to verify an orphan index, we're
cleaning this index from indexdir by calling ovl_cleanup_and_whiteout().
This dereferences ofs-&gt;workdir, that was earlier set to NULL.

The design was that ovl-&gt;workdir will point at ovl-&gt;indexdir, but we are
assigning ofs-&gt;indexdir to ofs-&gt;workdir only after ovl_indexdir_cleanup().
There is no reason not to do it sooner, because once we get success from
ofs-&gt;indexdir = ovl_workdir_create(... there is no turning back.

Reported-and-tested-by: Murphy Zhou &lt;jencce.kernel@gmail.com&gt;
Fixes: c21c839b8448 ("ovl: whiteout inode sharing")
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: inode reference leak in ovl_is_inuse true case.</title>
<updated>2020-07-15T22:05:40Z</updated>
<author>
<name>youngjun</name>
</author>
<published>2020-06-16T08:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24f14009b8f1754ec2ae4c168940c01259b0f88a'/>
<id>urn:sha1:24f14009b8f1754ec2ae4c168940c01259b0f88a</id>
<content type='text'>
When "ovl_is_inuse" true case, trap inode reference not put.  plus adding
the comment explaining sequence of ovl_is_inuse after ovl_setup_trap.

Fixes: 0be0bfd2de9d ("ovl: fix regression caused by overlapping layers detection")
Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Reviewed-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: youngjun &lt;her0gyugyu@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: remove unnecessary lock check</title>
<updated>2020-06-08T07:57:19Z</updated>
<author>
<name>youngjun</name>
</author>
<published>2020-06-07T09:04:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2068cf7dfbc69c4097c95af3a0bd943ced155a76'/>
<id>urn:sha1:2068cf7dfbc69c4097c95af3a0bd943ced155a76</id>
<content type='text'>
Directory is always locked until "out_unlock" label.  So lock check is not
needed.

Signed-off-by: youngjun &lt;her0gyugyu@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: make private mounts longterm</title>
<updated>2020-06-04T08:48:19Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2020-06-04T08:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df820f8de4e481222b17f9bcee7b909ae8167529'/>
<id>urn:sha1:df820f8de4e481222b17f9bcee7b909ae8167529</id>
<content type='text'>
Overlayfs is using clone_private_mount() to create internal mounts for
underlying layers.  These are used for operations requiring a path, such as
dentry_open().

Since these private mounts are not in any namespace they are treated as
short term, "detached" mounts and mntput() involves taking the global
mount_lock, which can result in serious cacheline pingpong.

Make these private mounts longterm instead, which trade the penalty on
mntput() for a slightly longer shutdown time due to an added RCU grace
period when putting these mounts.

Introduce a new helper kern_unmount_many() that can take care of multiple
longterm mounts with a single RCU grace period.

Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: get rid of redundant members in struct ovl_fs</title>
<updated>2020-06-04T08:48:19Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2020-06-04T08:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8e42a651bdee06202ebdd96cff64fdeabd5b1d6'/>
<id>urn:sha1:b8e42a651bdee06202ebdd96cff64fdeabd5b1d6</id>
<content type='text'>
ofs-&gt;upper_mnt is copied to -&gt;layers[0].mnt and -&gt;layers[0].trap could be
used instead of a separate -&gt;upperdir_trap.

Split the lowerdir option early to get the number of layers, then allocate
the -&gt;layers array, and finally fill the upper and lower layers, as before.

Get rid of path_put_init() in ovl_lower_dir(), since the only caller will
take care of that.

[Colin Ian King] Fix null pointer dereference on null stack pointer on
error return found by Coverity.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: add accessor for ofs-&gt;upper_mnt</title>
<updated>2020-06-04T08:48:19Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2020-06-04T08:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08f4c7c86d4cf125389dce9d94423024549f9b02'/>
<id>urn:sha1:08f4c7c86d4cf125389dce9d94423024549f9b02</id>
<content type='text'>
Next patch will remove ofs-&gt;upper_mnt, so add an accessor function for this
field.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
<entry>
<title>ovl: sync dirty data when remounting to ro mode</title>
<updated>2020-05-13T09:11:24Z</updated>
<author>
<name>Chengguang Xu</name>
</author>
<published>2020-04-22T04:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=399c109d357a7e217cf7ef551e7e234439c68c15'/>
<id>urn:sha1:399c109d357a7e217cf7ef551e7e234439c68c15</id>
<content type='text'>
sync_filesystem() does not sync dirty data for readonly filesystem during
umount, so before changing to readonly filesystem we should sync dirty data
for data integrity.

Signed-off-by: Chengguang Xu &lt;cgxu519@mykernel.net&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
</content>
</entry>
</feed>
