linux/fs/overlayfs
Christian Brauner f723edb8a5 ovl: check type and offset of struct vfsmount in ovl_entry
Porting overlayfs to the new amount api I started experiencing random
crashes that couldn't be explained easily. So after much debugging and
reasoning it became clear that struct ovl_entry requires the point to
struct vfsmount to be the first member and of type struct vfsmount.

During the port I added a new member at the beginning of struct
ovl_entry which broke all over the place in the form of random crashes
and cache corruptions. While there's a comment in ovl_free_fs() to the
effect of "Hack! Reuse ofs->layers as a vfsmount array before freeing
it" there's no such comment on struct ovl_entry which makes this easy to
trip over.

Add a comment and two static asserts for both the offset and the type of
pointer in struct ovl_entry.

Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2023-06-19 14:02:00 +03:00
..
copy_up.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
dir.c ovl: move ovl_entry into ovl_inode 2023-06-19 14:01:13 +03:00
export.c ovl: deduplicate lowerpath and lowerstack[] 2023-06-19 14:01:13 +03:00
file.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
inode.c ovl: prepare for lazy lookup of lowerdata inode 2023-06-19 14:01:14 +03:00
Kconfig ovl: Kconfig: Fix spelling mistake "undelying" -> "underlying" 2022-12-08 10:49:46 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
overlayfs.h ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
ovl_entry.h ovl: check type and offset of struct vfsmount in ovl_entry 2023-06-19 14:02:00 +03:00
readdir.c fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
super.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00
util.c ovl: implement lazy lookup of lowerdata in data-only layers 2023-06-19 14:01:14 +03:00