2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-19 02:54:00 +08:00
linux-next/fs/overlayfs
Amir Goldstein 9c6d8f13e9 ovl: fix corner case of non-unique st_dev;st_ino
On non-samefs overlay without xino, non pure upper inodes should use a
pseudo_dev assigned to each unique lower fs and pure upper inodes use the
real upper st_dev.

It is fine for an overlay pure upper inode to use the same st_dev;st_ino
values as the real upper inode, because the content of those two different
filesystem objects is always the same.

In this case, however:
 - two filesystems, A and B
 - upper layer is on A
 - lower layer 1 is also on A
 - lower layer 2 is on B

Non pure upper overlay inode, whose origin is in layer 1 will have the same
st_dev;st_ino values as the real lower inode. This may result with a false
positive results of 'diff' between the real lower and copied up overlay
inode.

Fix this by using the upper st_dev;st_ino values in this case.  This breaks
the property of constant st_dev;st_ino across copy up of this case. This
breakage will be fixed by a later patch.

Fixes: 5148626b80 ("ovl: allocate anon bdev per unique lower fs")
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2019-12-10 16:00:55 +01:00
..
copy_up.c ovl: don't use a temp buf for encoding real fh 2019-12-10 16:00:55 +01:00
dir.c SPDX update for 5.2-rc6 2019-06-21 09:58:42 -07:00
export.c ovl: make sure that real fid is 32bit aligned in memory 2019-12-10 16:00:55 +01:00
file.c SPDX update for 5.2-rc6 2019-06-21 09:58:42 -07:00
inode.c ovl: fix corner case of non-unique st_dev;st_ino 2019-12-10 16:00:55 +01:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: make sure that real fid is 32bit aligned in memory 2019-12-10 16:00:55 +01:00
overlayfs.h ovl: make sure that real fid is 32bit aligned in memory 2019-12-10 16:00:55 +01:00
ovl_entry.h ovl: fix lookup failure on multi lower squashfs 2019-12-10 16:00:55 +01:00
readdir.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
super.c ovl: fix lookup failure on multi lower squashfs 2019-12-10 16:00:55 +01:00
util.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00