summaryrefslogtreecommitdiff
path: root/fs/overlayfs/super.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2023-06-13 11:13:37 +0300
committerAmir Goldstein <amir73il@gmail.com>2023-06-19 14:02:00 +0300
commitf723edb8a532cd26e1ff0a2b271d73762d48f762 (patch)
tree5811c7a694a1a528abf025ba41d290e575d2e3a7 /fs/overlayfs/super.c
parent42dd69ae1af42cf72d167e63a039b8c63653eb7f (diff)
downloadlinux-f723edb8a532cd26e1ff0a2b271d73762d48f762.tar.xz
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>
Diffstat (limited to 'fs/overlayfs/super.c')
0 files changed, 0 insertions, 0 deletions