]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - fs/overlayfs/copy_up.c
ovl: verify index dir matches upper dir
authorAmir Goldstein <amir73il@gmail.com>
Wed, 21 Jun 2017 12:28:38 +0000 (15:28 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:17 +0000 (22:03 +0200)
commit54fb347e836faadaed2a5617fb4dd4a4597d0490
tree776d77e3848edf181ebeeda5bea8169c8937c6bc
parent8b88a2e6403638b56556ed5b1c60d9318eefea9c
ovl: verify index dir matches upper dir

An index dir contains persistent hardlinks to files in upper dir.
Therefore, we must never mount an existing index dir with a differnt
upper dir.

Store the upper root dir file handle in index dir inode when index
dir is created and verify the file handle before using an existing
index dir on mount.

Add an 'is_upper' flag to the overlay file handle encoding and set it
when encoding the upper root file handle. This is not critical for index
dir verification, but it is good practice towards a standard overlayfs
file handle format for NFS export.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c
fs/overlayfs/namei.c
fs/overlayfs/overlayfs.h
fs/overlayfs/super.c