android_kernel_xiaomi_sm8450/fs/overlayfs
Christian Brauner a2966e0436 ovl: check type and offset of struct vfsmount in ovl_entry
[ Upstream commit f723edb8a532cd26e1ff0a2b271d73762d48f762 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-26 15:26:44 +02:00
..
copy_up.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
dir.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
export.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
file.c ovl: remove privs in ovl_fallocate() 2023-02-22 12:55:55 +01:00
inode.c ovl: perform vfs_getxattr() with mounter creds 2021-02-17 11:02:22 +01:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
overlayfs.h ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
ovl_entry.h ovl: check type and offset of struct vfsmount in ovl_entry 2023-08-26 15:26:44 +02:00
readdir.c ovl: invalidate readdir cache on changes to dir with origin 2021-05-14 09:50:35 +02:00
super.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00
util.c ovl: update of dentry revalidate flags after copy up 2023-07-27 08:43:55 +02:00